• 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
Drawing a 1 pixel-perfect wide bordered NSBezierPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drawing a 1 pixel-perfect wide bordered NSBezierPath


  • Subject: Drawing a 1 pixel-perfect wide bordered NSBezierPath
  • From: Martin <email@hidden>
  • Date: Thu, 17 Apr 2008 00:52:04 +0200

Hi,

I'm trying to draw a rounded rectangle with a 1 pixel-perfect wide border. Although I made sure that the rect has integral values and its height it an even number (so that height/2.0 is also even), the top and bottom lines look blurry (screenshot: http://img01.picoodle.com/img/img01/4/4/16/f_Picture2m_d4f9168.png ). I don't want to disable anti-alias because of the rounded parts.

What's wrong with my code?

[controlView lockFocus];

NSBezierPath *rectangle = [NSBezierPath bezierPathWithRoundedRect:cellFrame xRadius:cellFrame.size.height/2.0 yRadius:cellFrame.size.height/2.0];

[[NSColor colorWithCalibratedRed:222.0/255.0 green:231.0/255.0 blue: 248.0/255.0 alpha:1.0] setFill];
[rectangle fill];


[[NSColor colorWithCalibratedRed:164.0/255.0 green:189.0/255.0 blue: 236.0/255.0 alpha:1.0] setStroke];
[rectangle setLineWidth:1.0];
[rectangle stroke];


[controlView unlockFocus];


Thanks, Martin. _______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Re: binary search trees & binning
  • Next by Date: Re: binary search trees & binning
  • Previous by thread: Re: NSArrayController bound to @unionOfArrays not updating
  • Next by thread: Re: Drawing a 1 pixel-perfect wide bordered NSBezierPath
  • Index(es):
    • Date
    • Thread