Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange NSView redraw problem




On Sep 30, 2006, at 12:39 AM, John Cassington wrote:

Hello,
I have a nsview class which is used more than once at a time. the view
can be 'selected' in that its background color can change based on a
boolean value.

when i change the 'selection' from view to view, the nsbezierpath used
to draw the curved border around the view does not clear properly.

here are two example images:
before: http://img88.imageshack.us/img88/7259/ beforemultipleredrawsvc7.png
after: http://img136.imageshack.us/img136/3713/ aftermultipleredrawsrz9.png


i think this has something to do with anti-aliasing, but i am not sure.

i am using the following three lines to try and clear the view before a redraw:

NSEraseRect([self frame]);
[[NSColor clearColor] set];
NSRectFill([self frame]);

Try removing the above three lines and then make sure if you implement isOpaque, that you return NO:


- (BOOL)isOpaque
{
    return NO;
}

Or, simply leave out isOpaque as by default, NSView returns NO.

___________________________________________________________
Ricky A. Sharp         mailto:email@hidden
Instant Interactive(tm)   http://www.instantinteractive.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Strange NSView redraw problem (From: "John Cassington" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.