• 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: Using affine transforms
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using affine transforms


  • Subject: Re: Using affine transforms
  • From: Graham Cox <email@hidden>
  • Date: Sat, 30 Apr 2011 10:26:58 +1000

On 30/04/2011, at 1:01 AM, McLaughlin, Michael P. wrote:

> appeared to have applied the transform to the path linewidth as well.  Is
> this how it is supposed to work?

Yes. A transform scales the whole drawing coordinate system, so the stroke width is scaled as well.

> Since this would seem to be a common task, is there a recommended way to
> keep linewidth = 1 (and likewise for data-point circles) or would I be
> better off just doing the transformations "manually" beforehand?


You can either a) compensate the linewidth by the inverse of the scale,  b) use a linewidth of 0, which will draw a 1-pixel wide line regardless of scale. However, this latter approach is not such a good idea if the view can be printed, because 1-pixel on a high resolution printer is extremely fine, or c) if your graph data is in the form of a path, you can scale the path by the transform rather than scale the view, then it will have the stroke width you give it. See [NSBezierPath transformUsingAffineTransform;] or [NSAffineTransform transformBezierPath:]

--Graham


_______________________________________________

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

References: 
 >Using affine transforms (From: "McLaughlin, Michael P." <email@hidden>)

  • Prev by Date: Re: Changing UISwitch text - correction
  • Next by Date: Re: Stack of NSWindow sheets
  • Previous by thread: Re: Using affine transforms
  • Next by thread: Hey,f
  • Index(es):
    • Date
    • Thread