• 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: Pascal Pochet <email@hidden>
  • Date: Tue, 21 Feb 2006 19:03:13 +0100

float radius = 8.0;

and

[path appendBezierPathWithArcFromPoint:topLeft toPoint:bottomLeft radius:newRadius];


is newRadius initialised somewhere ?


Pascal Pochet email@hidden


Le 21-févr.-06 à 18:52, I. Savant a écrit :

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.
--

Again - this works perfectly on PPC Macs. Nice, pretty, smooth rounded rectangles to surround my informational areas ... if I wanted a plain old box, I would've used NSBox! Does the Intel Mac just like to flatten stuff? ;-)

  Any assistance would be most appreciated.

--
I.S.


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40mac.com


This email sent to email@hidden




_______________________________________________
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: Round Rect FLAT on Intel
  • Next by Date: Re: Click = Toolbar Goes Blank!
  • Previous by thread: Round Rect FLAT on Intel
  • Next by thread: Re: Round Rect FLAT on Intel
  • Index(es):
    • Date
    • Thread