• 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: NSBezierPath linewidth not correct
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBezierPath linewidth not correct


  • Subject: Re: NSBezierPath linewidth not correct
  • From: Heinrich Giesen <email@hidden>
  • Date: Sun, 3 Jan 2010 12:29:35 +0100


On 03.01.2010, at 00:45, Rob Keniger wrote:


It will probably be easier to create an NSAffineTransform and translate the whole context by 0.5px, so all drawing is offset without you needing to fiddle with individual values.

Just a hint:
NSBezierPath has a method which allows to use NSAffineTransform for this even outside a rendering/drawing process:


Description of transformUsingAffineTransform, a method of NSBezierPath:
Transforms all points in the receiver using the specified transform.

- (void)transformUsingAffineTransform:(NSAffineTransform *)aTransform

Example:

NSBezierPath *bPath = // create a path
// construct the complete path
NSAffineTransform *transform = [NSAffineTransform transform];
// move all coordinates to the center of the pixels
[transform translateXBy: 0.5 yBy: 0.5 ];
[bPath transformUsingAffineTransform:transform];
// bPath is now ready for drawing


-- Heinrich Giesen email@hidden


_______________________________________________

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


  • Follow-Ups:
    • Re: NSBezierPath linewidth not correct
      • From: Gustavo Pizano <email@hidden>
  • Prev by Date: How do I bind custom view properties to an NSCollectionViewItem?
  • Next by Date: Re: Custom NSFormatter classes
  • Previous by thread: Re: NSBezierPath linewidth not correct
  • Next by thread: Re: NSBezierPath linewidth not correct
  • Index(es):
    • Date
    • Thread