• 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: NSAffineTransform scaleBy not scaling
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSAffineTransform scaleBy not scaling


  • Subject: Re: NSAffineTransform scaleBy not scaling
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Mon, 30 Nov 2009 20:07:46 -0600

On Mon, Nov 30, 2009 at 7:55 PM, Shane
<email@hidden> wrote:
> Anyone see what I'm doing wrong here, or know how to get the
> NSBezierPath to take up 90% of my NSView (leaving 10% blank for
> borders which is what I tried to do below)?

You call concat before you apply the scale. Do the translate, scale,
and then concat.

> - (void) drawRect:(NSRect) rect
> {
>        NSRect bounds = [self bounds];
>
>        float xAxis = bounds.size.width * 0.9;
>        float yAxis = bounds.size.height * 0.9;
>
>        [[NSColor blackColor] setFill];
>        [NSBezierPath fillRect:bounds];
>
>        NSAffineTransform *newTransform = [NSAffineTransform transform];
>        [newTransform translateXBy:40.0 yBy:30.0];
>        [newTransform concat];
>
>        // can't seem to get this transform to work as expected.
>        [newTransform scaleXBy:xAxis yBy:yAxis];
>
>        [self drawAxes:rect width:xAxis height:yAxis];
>        [self drawGraph:rect];
>
>        return;
> }
> _______________________________________________
>
> 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
>
_______________________________________________

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: 
 >NSAffineTransform scaleBy not scaling (From: Shane <email@hidden>)

  • Prev by Date: Re: totally baffled by "odoc" apple event failing on launch
  • Next by Date: Re: NSAffineTransform scaleBy not scaling
  • Previous by thread: NSAffineTransform scaleBy not scaling
  • Next by thread: Re: NSAffineTransform scaleBy not scaling
  • Index(es):
    • Date
    • Thread