• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Round Rect FLAT on Intel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Round Rect FLAT on Intel


  • Subject: Re: Round Rect FLAT on Intel
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 21 Feb 2006 17:49:45 -0800


On Feb 21, 2006, at 9:52 AM, I. Savant 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! :-)


Does this work on your intel box?


@implementation NSBezierPath (MorePathExtensions)

+ (NSBezierPath *) bezierPathWithRoundRectInRect:(NSRect) rect withRadius:(float) radius
{
id path = [self bezierPath];
[path moveToPoint:NSMakePoint(NSMidX(rect), NSMinY(rect))];
[path appendBezierPathWithArcFromPoint: NSMakePoint(NSMaxX(rect), NSMinY(rect))
toPoint: NSMakePoint(NSMaxX(rect), NSMaxY(rect))
radius: radius];


[path appendBezierPathWithArcFromPoint: NSMakePoint(NSMaxX(rect), NSMaxY(rect))
toPoint: NSMakePoint(NSMidX(rect), NSMaxY(rect))
radius: radius];


[path appendBezierPathWithArcFromPoint: NSMakePoint(NSMinX(rect), NSMaxY(rect))
toPoint: NSMakePoint(NSMinX(rect), NSMinY(rect))
radius: radius];


[path appendBezierPathWithArcFromPoint: NSMakePoint(NSMinX(rect), NSMinY(rect))
toPoint: NSMakePoint(NSMidX(rect), NSMinY(rect))
radius: radius];
[path closePath];
return path;
}


@end

-jcr
_______________________________________________
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


References: 
 >Round Rect FLAT on Intel (From: "I. Savant" <email@hidden>)

  • Prev by Date: NSScriptCoercionHandler ?
  • Next by Date: Re: Replicate custom view in code
  • Previous by thread: Re: Round Rect FLAT on Intel
  • Next by thread: Remove some (and not all) actions from the undo stack
  • Index(es):
    • Date
    • Thread