mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 17:35:36 +00:00
f32: add Point.Div
Signed-off-by: Pierre Curto <pierre.curto@gmail.com>
This commit is contained in:
@@ -66,6 +66,11 @@ func (p Point) Mul(s float32) Point {
|
|||||||
return Point{X: p.X * s, Y: p.Y * s}
|
return Point{X: p.X * s, Y: p.Y * s}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Div returns the vector p/s.
|
||||||
|
func (p Point) Div(s float32) Point {
|
||||||
|
return Point{X: p.X / s, Y: p.Y / s}
|
||||||
|
}
|
||||||
|
|
||||||
// In reports whether p is in r.
|
// In reports whether p is in r.
|
||||||
func (p Point) In(r Rectangle) bool {
|
func (p Point) In(r Rectangle) bool {
|
||||||
return r.Min.X <= p.X && p.X < r.Max.X &&
|
return r.Min.X <= p.X && p.X < r.Max.X &&
|
||||||
|
|||||||
Reference in New Issue
Block a user