Figuring out what rects have been invalidated in drawrect after doing multiple setneedsdisplayinrect

129 Views Asked by At

I'm drawing images in a grid formation. Some of the images will move, and I need to update the display, but obviously, I don't want to refresh the whole screen unnecessarily. I am using SetNeedsDisplayInRect multiple times but sometimes, it seems (and I'm getting this from other sources) UIKit will invalidate extra rects. I don't mind redrawing these extra blocks, but I need to know what extra blocks are being invalidated.

I'm currently keeping an array of the rects I need to refresh, but when the system does extra ones, I wind up with empty squares because I didn't expect to redraw them.

DrawRect has the parameter, but it is a single rectangle which encompasses the invalided areas. Is there a way to determine these extra rectangles?

0

There are 0 best solutions below