Using colorWithCalibratedWhite with NSScrollView
Using colorWithCalibratedWhite with NSScrollView
- Subject: Using colorWithCalibratedWhite with NSScrollView
- From: John Blackburn <email@hidden>
- Date: Thu, 4 Apr 2002 19:06:31 -0800
My application uses "rubber-band" drag selection to select a group of
arbitrarily placed items within a scrolling view (like the Finder in
icon view). To draw the selected rect, I use the following within
drawRect:
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.15] set];
NSRectFillUsingOperation(mySelectionBounds, NSCompositeSourceAtop);
This works great and draws a shaded rectangle just like the Finder's.
In fact, those two lines came from someone at Apple, though I don't now
remember who. But when the view is scrolled all the way over to the
right so that the very rightmost pixel of the view is visible, the
shading suddenly gets much, much darker. In fact, it looks as though
the gray value is inverted to be as near to black as it is supposed to
be to white.
Those two lines are adjacent as is in my code with nothing executing
between and the background is consistently white. How can this result
in two differently shaded rects depending on scroll position?
Has anyone else encountered this and found an explanation? I'll file a
bug if I don't hear anything.
Thanks,
John Blackburn
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.