I have an image.Point
and an image.Rectangle
. I'd like to know how to check if the point is in the rectangle. I know that I can manually check with:
p := image.Point{}
r := image.Rect{}
if r.Min.X <= p.X && p.X < r.Max.X && r.Min.Y <= p.Y && p.Y < r.Max.Y {
// Point is in the rectangle!
}
But that is a pain! Is there a better way to do this? I can't find a Contains()
in the documentation.