In easy English can someone please explain to me this line of code.
public bool IsAt(Point2D pt)
{
return (pt.X > Width && pt.X < Width X && pt.Y > Height && pt.Y < Height Y);
}
CodePudding user response:
Return true if the coordinates pt.X, pt.Y are outside a rectangle with width: WIDTH and height: HEIGHT with an origin at coordinates X, Y.
CodePudding user response:
Assuming Width and Height are actually the width and the height of a defined rectangle, then I'd go with the class System.Drawing.Rectangle and use the method Contains() to check if a point is in a rectangle.
