• 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: bug in NSGradient?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug in NSGradient?


  • Subject: Re: bug in NSGradient?
  • From: Gregory Weston <email@hidden>
  • Date: Sat, 22 Nov 2008 14:23:33 -0500

Graham Cox wrote:

Just noticed this, not what I was expecting. I'll file a bug unless
someone can convincingly explain it's correct behaviour...

[NSGradient interpolatedColorAtLocation:<value>];

If the gradient has stops that run from, say, 0.5 to 1.0, but <value>
is less than 0.5, this method returns nil. I would have expected it to
return the extended colour, i.e. the first one in this case.

The discussion for this method says:

"This method does not simply return the color values used to
initialize the receiver. Instead, it computes the value that would be
drawn at the specified location."

For the case above this depends on whether the gradient will be drawn
with the colour extending flags set, but since this method doesn't
know about those flags, it's not well-defined. I would suggest that
the method should assume the flags are set, since that's a useful
assumption, whereas the opposite isn't.

I'll agree that the documentation should be clarified, but I'm not sure what the rationale is for claiming that it's not useful for the method to indicate that the gradient doesn't draw at all at a certain location.


G
_______________________________________________

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


  • Prev by Date: Re: Fastest way to resize an image?
  • Next by Date: Re: bug in NSGradient?
  • Previous by thread: Re: bug in NSGradient?
  • Next by thread: Testing components within an application
  • Index(es):
    • Date
    • Thread