• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cutsom NSRulerView : strange problems with drawing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cutsom NSRulerView : strange problems with drawing


  • Subject: Re: Cutsom NSRulerView : strange problems with drawing
  • From: Eric MORAND <email@hidden>
  • Date: Tue, 22 May 2007 12:15:09 +0200

Thanks for the clarifications.

Still, there is a mystery with the way NSRulverView draws. Since it is drawing only its "dirty" rect most of the time (when the scale change, you must be right and it must redraw its entire bounds area), I'm wondering how its draws the areas not "dirty".

For instance, let's say I have a scroll view with a width of 650. The ruler view is also 650 wide, and 16 pixels high. When I scroll my scrollView 5 pixels to the right, the ruler view only draws the rect (645, 0, 5, 16), that means only its 5 last pixels. How are the 645 previous pixels drawn ?

Is this some kind of magic ?

Le 22 mai 07 à 11:55, Uli Kusterer a écrit :

On 22.05.2007, at 11:11, Eric MORAND wrote:
Well, the standard behavior of NSRulerView tends to prove that the drawRect... methods are allowed to draw outside the "dirty" rect : when a ruler is scaled, it redisplays every hash marks in its bound area (not only in the "dirty" rect) to match the stepUp and stepDown cycles of the current measure unit.

My guess would be that either the ruler view itself or the owner of it knows the thing is being scaled and invalidates that. The view can draw wherever it wants, but it can't rely on being able to redraw non-invalidated areas. That simply doesn't work reliably. It's the API contract: To redraw something, first invalidate it.


Of course you can send off drawing commands for everything, but it's up to AppKit to clip or draw as it pleases.

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


  • Follow-Ups:
    • Re: Cutsom NSRulerView : strange problems with drawing
      • From: Uli Kusterer <email@hidden>
References: 
 >Cutsom NSRulerView : strange problems with drawing (From: Eric MORAND <email@hidden>)
 >Re: Cutsom NSRulerView : strange problems with drawing (From: Uli Kusterer <email@hidden>)
 >Re: Cutsom NSRulerView : strange problems with drawing (From: Eric MORAND <email@hidden>)
 >Re: Cutsom NSRulerView : strange problems with drawing (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: Cutsom NSRulerView : strange problems with drawing
  • Next by Date: NSPopUpButton Notifications
  • Previous by thread: Re: Cutsom NSRulerView : strange problems with drawing
  • Next by thread: Re: Cutsom NSRulerView : strange problems with drawing
  • Index(es):
    • Date
    • Thread