On Mon, Nov 30, 2009 at 7:55 PM, Shane
<software.research.developm...@gmail.com> 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 (Cocoa-dev@lists.apple.com)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/stephen.butler%40gmail.com
>
> This email sent to stephen.but...@gmail.com
>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to