Re: Round Rect FLAT on Intel
Re: Round Rect FLAT on Intel
- Subject: Re: Round Rect FLAT on Intel
- From: Ricky Sharp <email@hidden>
- Date: Tue, 21 Feb 2006 12:48:30 -0600
On Tuesday, February 21, 2006, at 11:52AM, I. Savant <email@hidden> wrote:
>List:
>
> I just got my new MacBook Pro today (yay!). After I settled on, I
>fired up XCode and my current project to see how it compiles.
>
> Nice and fast, no errors whatsoever.
>
> Running, however, is a different story. :-) The code below behaves
>correctly on the PPC (ie, it draws rounded rectangles). On my new
>Intel toy, it draws a straight-edged, normal-looking rectangle ...
>BOOOOORRRRIINNNGGG! :-)
>
>--
>// ... do some unrelated drawing here ...
>// ... fill the background, blah blah ...
>
>// Establish drawing metrics
>float radius = 8.0;
>NSPoint topMid = NSMakePoint(NSMidX(rect), NSMaxY(rect));
>NSPoint topLeft = NSMakePoint(NSMinX(rect), NSMaxY(rect));
>NSPoint topRight = NSMakePoint(NSMaxX(rect), NSMaxY(rect));
>NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect));
>NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect));
>
>// Draw rounded rect
>NSBezierPath * path = [NSBezierPath bezierPath];
>[path moveToPoint:topMid];
>[path appendBezierPathWithArcFromPoint:topLeft toPoint:bottomLeft
>radius:newRadius];
>[path appendBezierPathWithArcFromPoint:bottomLeft toPoint:bottomRight
>radius:newRadius];
>[path appendBezierPathWithArcFromPoint:bottomRight toPoint:topRight
>radius:newRadius];
>[path appendBezierPathWithArcFromPoint:topRight toPoint:topLeft
>radius:newRadius];
>[path closePath];
>
>// ... go on to set color and fill/stroke.
In your calls to appendBezierPathWithArcFromPoint, you're using a radius of newRadius. Was that supposed to be radious? Do you possibly have two floats in your code that are not both being initialized?
--
_______________________________________________
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