Unwanted scaled line width
Unwanted scaled line width
- Subject: Unwanted scaled line width
- From: Lorenzo <email@hidden>
- Date: Mon, 25 Oct 2004 11:40:06 +0200
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 ];
Now I get the correct line width on all the 4 sides, but since bezierPath
are antialiased, I get a very thiny line blended with the background. Bad
result. Do you know how to do what I am trying to do?
Thanks
--
Lorenzo
email: email@hidden
_______________________________________________
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