How do I go about making boundaries on drawing an NSMakeRect when my x and y coordinates are equal to the mouse coordinates. I do not want my NSRect to be drawn past a certain coordiante
NSMakeRect(mouseLoc.x, mouseLoc.y, 50, 50);
Do I create a range or max x and y values and if so how do i incorporate it into my MakeRect?
Thanks
If you’re building 64-bit, then
NSRectistypedefed to beCGRect. You can do the following:So you construct the new rectangle, see if it’s contained in the larger bounding rectangle, and if so, replace the old one with the new one. Otherwise, use the old one again.