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

Re: scaleUnitSquareToSize


  • Subject: Re: scaleUnitSquareToSize
  • From: Kyle Sluder <email@hidden>
  • Date: Sat, 16 Oct 2010 14:19:43 -0700

On Sat, Oct 16, 2010 at 2:09 PM,  <email@hidden> wrote:
> I am using scaleUnitSquareToSize to zoom out / zoom in on a design being
> created in a subclass of NSView.
>
> After calling:
>
> - (IBAction)zoom:(id)sender {
>
>        NSSize sz = NSSizeFromString(@"{0.75,0.75}");
>        [self scaleUnitSquareToSize:sz];
>        [self display];
> }

Also, is this really the code you're using to scale your view?

1. Why are you using NSSizeFromString rather than NSMakeSize?
2. Do not call -display. Call -setNeedsDisplay: and let AppKit
coalesce -display for you.
3. Consider not using -scaleUnitSquareToSize: at all. Experience has
shown me that it usually makes more sense to keep a separate scale
factor and leave your view's bounds coordinate system unscaled.

--Kyle Sluder
_______________________________________________

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: scaleUnitSquareToSize
      • From: email@hidden
References: 
 >scaleUnitSquareToSize (From: email@hidden)

  • Prev by Date: Re: scaleUnitSquareToSize
  • Next by Date: Re: scaleUnitSquareToSize
  • Previous by thread: Re: scaleUnitSquareToSize
  • Next by thread: Re: scaleUnitSquareToSize
  • Index(es):
    • Date
    • Thread