FROM : Aaron Wallis
DATE : Sat Apr 26 11:34:23 2008
Oh!!
LEGEND!!!
That totally fixed the bug!
for the record, the following code fixes the artefacts:
- ( void ) drawRect: ( NSRect ) rect
{
NSBezierPath* thePath = [NSBezierPath bezierPath];
[thePath appendBezierPathWithRoundedRect:[self bounds] xRadius:10.0
yRadius:10.0];
[thePath fill];
}
Thanks Jean-Daniel
On 26/04/2008, at 7:27 PM, Jean-Daniel Dupas wrote:
> The "rect" arguments is not you whole frame. This is only the rect
> that need to be redraw. It may be smaller than your view.
> If you want to fill you view using a rounded rect, so you have to
> use [self bounds] instead of rect.
>
>
> Le 26 avr. 08 à 07:18, Aaron Wallis a écrit :
>
>> I've been having a fair few issues with NSBezier boxes lately
>> (a.k.a boxes with rounded corners)
>>
>> I've created a NSView subclass that contains the following code,
>> then threw a few on a window with some controls over the top:
>> - ( void ) drawRect: ( NSRect ) rect
>> {
>> NSBezierPath* thePath = [NSBezierPath bezierPath];
>> [thePath appendBezierPathWithRoundedRect:rect xRadius:10.0
>> yRadius:10.0];
>> [thePath fill];
>> }
>>
>> the results are horrid: http://skitch.com/d2kagw/kemd/window
>> there's loads of artifacts on the initial draw as well as each when
>> the user interacts with the controls etc.
>>
>> If I make them just plain rectangles - it works fine: http://skitch.com/d2kagw/kemr/window
>> - ( void ) drawRect: ( NSRect ) rect
>> {
>> [NSBezierPath fillRect:rect];
>> }
>>
>> Any ideas?
>> I just need to draw some boxes :D
>>
>> Cheers!
>>
>> ________________________/Az.________
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>
>>
>
________________________/Az.________
DATE : Sat Apr 26 11:34:23 2008
Oh!!
LEGEND!!!
That totally fixed the bug!
for the record, the following code fixes the artefacts:
- ( void ) drawRect: ( NSRect ) rect
{
NSBezierPath* thePath = [NSBezierPath bezierPath];
[thePath appendBezierPathWithRoundedRect:[self bounds] xRadius:10.0
yRadius:10.0];
[thePath fill];
}
Thanks Jean-Daniel
On 26/04/2008, at 7:27 PM, Jean-Daniel Dupas wrote:
> The "rect" arguments is not you whole frame. This is only the rect
> that need to be redraw. It may be smaller than your view.
> If you want to fill you view using a rounded rect, so you have to
> use [self bounds] instead of rect.
>
>
> Le 26 avr. 08 à 07:18, Aaron Wallis a écrit :
>
>> I've been having a fair few issues with NSBezier boxes lately
>> (a.k.a boxes with rounded corners)
>>
>> I've created a NSView subclass that contains the following code,
>> then threw a few on a window with some controls over the top:
>> - ( void ) drawRect: ( NSRect ) rect
>> {
>> NSBezierPath* thePath = [NSBezierPath bezierPath];
>> [thePath appendBezierPathWithRoundedRect:rect xRadius:10.0
>> yRadius:10.0];
>> [thePath fill];
>> }
>>
>> the results are horrid: http://skitch.com/d2kagw/kemd/window
>> there's loads of artifacts on the initial draw as well as each when
>> the user interacts with the controls etc.
>>
>> If I make them just plain rectangles - it works fine: http://skitch.com/d2kagw/kemr/window
>> - ( void ) drawRect: ( NSRect ) rect
>> {
>> [NSBezierPath fillRect:rect];
>> }
>>
>> Any ideas?
>> I just need to draw some boxes :D
>>
>> Cheers!
>>
>> ________________________/Az.________
>> _______________________________________________
>>
>> Cocoa-dev mailing list (<email_removed>)
>>
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>>
>> This email sent to <email_removed>
>>
>
________________________/Az.________
| Related mails | Author | Date |
|---|---|---|
| Aaron Wallis | Apr 26, 07:18 | |
| Jean-Daniel Dupas | Apr 26, 11:27 | |
| Aaron Wallis | Apr 26, 11:34 | |
| John C. Randolph | Apr 27, 04:09 |






Cocoa mail archive

