Re: Invalidating Rects for redraw
Re: Invalidating Rects for redraw
- Subject: Re: Invalidating Rects for redraw
- From: David Martin <email@hidden>
- Date: Fri, 26 Jul 2002 10:02:47 +0200
On Tuesday, July 23, 2002, at 11:41 , Richard Schreyer wrote:
It seems that when you roll over a link, the area of that link is
marked for redraw (highlight color, whatever...), and the progress text
in the lower left is also marked for redraw (to display the new URL).
The problem is that Cocoa appears to be unioning these rects, meaning
that much more is being redrawn than needs to be. If you roll over a
link near the top of a page, almost the entire page needs to be redrawn.
I've found indeed that sending a [self setNeedsDisplayInRect:aRect] to a
NSView, and then a [self setNeedsDisplayInRect:anotherRect] will
actually redraw a single rectangle containing the two smaller rectangles.
My workaround was to call [self displayRect:aRect], then [self
displayRect:anotherRect]. The documentation seems to want people to call
-setNeedsDisplayInRect: and let the view redraw itself when it wants it,
but the thing looks terribly inefficient
Bye,
David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.