Re: display optimization / display rectangles
Re: display optimization / display rectangles
- Subject: Re: display optimization / display rectangles
- From: Quincey Morris <email@hidden>
- Date: Thu, 14 May 2009 11:18:39 -0700
On May 14, 2009, at 10:09, David Harper wrote:
In my document view class' drawRect: method, everything in the
document overlapping the display rectangle is drawn. However, my
pages are drawn as rectangular bezier paths with attached NSShadows,
so I draw an entire page if it overlaps the display rectangle. The
problem is that even though calling [pagePath fill] does not
actually cause the document view to actually draw the entire
contents of the fill (but rather what overlaps the display
rectangle, as expected), subviews outside the display rectangle that
overlap the page rectangle are recursively displayed in their
entirety.
Can you expand on this issue a little? If pagePath is a NSBezierPath,
filling the path shouldn't itself cause anything else to be drawn, so
your drawing code is not likely to be the cause of the unwanted extra
drawing.
Assuming you're doing nothing to violate the paradigm that drawing
occurs only in response to setNeedsDisplay/setNeedsDisplayInRect, then
the problem is likely that you're somehow invoking setNeedsDisplay...
on too many things.
You aren't by any chance calling setNeedsDisplay... from within a
drawRect: method, are you? That would be a Really Bad Thing to do.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden