Re: Round Corners With BezierPath
Re: Round Corners With BezierPath
- Subject: Re: Round Corners With BezierPath
- From: Chad Seldomridge <email@hidden>
- Date: Tue, 22 Aug 2006 22:27:44 -0600
On Aug 22, 2006, at 10:03 PM, email@hidden wrote:
Message: 11
Date: Tue, 22 Aug 2006 21:33:24 -0400
From: Tom Marchand <email@hidden>
Subject: Round Corners With BezierPath
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
Hi,
I am trying to draw a rectangle with round corners using NSBezierPath
and I am not having much luck. Here's the code:
NSRect myBounds = [self bounds];
NSBezierPath *Box;
[NSBezierPath setDefaultLineJoinStyle:NSRoundLineJoinStyle];
Box=[NSBezierPath bezierPathWithRect: myBounds];
[Box stroke];
The corners are always square no matter what I set the JoinStyle to
although [Box lineJoinStyle] returns the style I set in my code. Any
idea what I am doing wrong?
I have some code here http://web.mac.com/cseldomridge/iWeb/Software/
Downloads.html
which draws a rectangle with rounded corners. It's at the bottom of
the page in the
Waveform Control Demo source code (WaveformCell.m). I may be doing
this the hard way,
but I am drawing the rounded rect by appending lines and arcs to a
NSBezierPath.
The setDefaultLineJoinStyle method is for setting the corner shape
when two lines meet.
The size of this join style rounded edge will be no larger than your
line width.
chad seldomridge
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden