Re: Cutsom NSRulerView : strange problems with drawing
Re: Cutsom NSRulerView : strange problems with drawing
- Subject: Re: Cutsom NSRulerView : strange problems with drawing
- From: Uli Kusterer <email@hidden>
- Date: Tue, 22 May 2007 10:19:31 +0200
On 22.05.2007, at 09:51, Eric MORAND wrote:
The problem is that the hash mark supposed to draw at bounds origin
is not drawn when I scroll to the right...and is drawn multiple
times when I scroll to the left ! Even so the entire bounds area
has already been filled by drawBackgroundInRect.
Can someone help me on this ?
You are asked to draw in a particular rect. Don't draw outside of
that (well, you can to make it easier, but really, it's just a waste
of cycles, because as you noticed it'll get clipped). If you have to
draw more because something was added to your ruler, invalidate the
area that needs to be redrawn (using one of the setNeedsDisplay...
methods, I'd guess). The OS tries to optimize drawing by only drawing
what has been marked as "dirty". If you don't tell it what is dirty,
it will never know to ask you to redraw that area.
Could that be your problem?
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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