• 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: NSSlider responding to superview's drawRect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSlider responding to superview's drawRect


  • Subject: Re: NSSlider responding to superview's drawRect
  • From: Graham Cox <email@hidden>
  • Date: Wed, 11 Jun 2008 09:18:55 +1000

I don't think it's worth attempting. I *think* that gradients are cached in some way so trying to recalculate the gradient to span the update rect correctly is: a) going to need a fair bit of work to calculate and b) not allow caching to work efficiently. In any case, pixels that are clipped out shouldn't be being drawn anyway, so the performance gain is likely to be miniscule.

G.

On 11 Jun 2008, at 7:22 am, Michael Watson wrote:

This is normally what I have to do as well, but is there a more optimized way to achieve the goal of drawing only the rect that needs redrawing?


-- m-s

On 10 Jun, 2008, at 12:05, Ken Ferry wrote:

You're probably filling your gradient into the rect passed in drawRect.

That rectangle just represents the dirty part of your view. If you had a solid color to draw, you could just fill the rect, but with a gradient you will get your gradient, top to bottom, within this possibly small rect within your view.

Try drawing the gradient into [self bounds] instead. This describes the location of the entire view in its own coordinate system.


_______________________________________________

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


References: 
 >NSSlider responding to superview's drawRect (From: Jonathan Dann <email@hidden>)
 >Re: NSSlider responding to superview's drawRect (From: Ken Ferry <email@hidden>)
 >Re: NSSlider responding to superview's drawRect (From: Michael Watson <email@hidden>)

  • Prev by Date: Re: Prevent Asynchronous operation of beginSheetModalForWindow
  • Next by Date: Re: launching standard apps with NSTask
  • Previous by thread: Re: NSSlider responding to superview's drawRect
  • Next by thread: Selectable NSTextFieldCell and NSTextField break attributed strings when selected
  • Index(es):
    • Date
    • Thread