I have to draw a NSShadow out of my NSViews' bounds.
So I overrided the wantsDefaultClipping methond returning NO.

That works, but not yet so well as I epxected.
For example, when I move the view and setNeedsDisplay:YES, the area outside
the view get not refreshed. So I subclassed setNeedsDisplay enlarging the
area to be refreshed.

- (void)setNeedsDisplay:(BOOL)flag
{
    [self.superview setNeedsDisplayInRect:NSInsetRect(self.frame,
-mInsetForShadow, -mInsetForShadow)];
}

Is it correct? As I have read on the docs, it's not recommended to draw
outside the bounds. So, I ask:

A) What's the purpose of the wantsDefaultClipping method?
B) Should I draw the shadow using a brand new NSView?
C) Or should I simply enlarge the view to draw the shadow? If so, I have to
change the origin and size of the view. Therefore, how can I adjust the
origin and size that the user enters on UI with the bound values I use in
the setFrameOrigin and setFrameSize ?


Regards
-- Leonardo


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to