Re: Unwanted scaled line width
Re: Unwanted scaled line width
- Subject: Re: Unwanted scaled line width
- From: stephane sudre <email@hidden>
- Date: Mon, 25 Oct 2004 11:52:10 +0200
On Oct 25, 2004, at 11:40 AM, Lorenzo wrote:
Hi list,
I scaled my NSView only on the X axis.
[aView scaleUnitSquareToSize:NSMakeSize(2.0, 1)];
Then all the objects within this view are scaled properly. Well.
However, since my objects are bordered with
NSFrameRectWithWidth([self bounds], 2.0);
now I see that the orizontal border line width is always 2.0 (correct)
but
the vertical border line width is 4.0... I know this is the result of
the
scaling, but I would not get this. I would like to scale the size of
the
objects, but I would not scale the line width.
So, instead of drawing a rect around the object, I have tried to draw 4
single lines. Firstly I draw the horizontal lines with the border 2.0,
then the vertical lines with the border = 2.0 / scaleFactor (which is
1.0,
which will be multiplied by 2 automatically).
aPoint = NSMakePoint(0.0, 0.0);
bPoint = NSMakePoint(0.0, h);
[NSBezierPath setDefaultLineWidth:(width / scaleFactor )];
[NSBezierPath strokeLineFromPoint:aPoint toPoint:bPoint ];
NSMakePoint(0.5f,0.0f);
NSMakePoint(0.5f,h);
That usually works for single point wide line
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden