gg/mx/size.go
2024-05-28 13:24:12 +05:00

18 lines
478 B
Go

package mx
// The type describes a simple
// rectangle without transformations.
type Size struct {
// The upper left corner position point.
Position Vector
// Absolute width and height.
// Both must be positive values.
Width, Height Float
}
func (size Size) ContainsPoint(pt Vector) bool {
return (size.Position.X < pt.X && (size.Position.X + size.Width) > pt.X ) &&
(size.Position.Y < pt.Y && (size.Position.Y + size.Height) > pt.Y )
}
//type (s Size) ContainsPoint