NSBezierPath linewidth not correct
NSBezierPath linewidth not correct
- Subject: NSBezierPath linewidth not correct
- From: Gustavo Pizano <email@hidden>
- Date: Sat, 2 Jan 2010 11:29:59 +0100
Hello all once again.
Well this is happening when drawing a line in a view which has a me after NSDrawNinePartImage as background; The Line it seems to be 2.0px;, this is what Im doing in drawRect
NSDrawNinePartImage(frame, _topLeft, _top, _topRight, _leftCallout, _center, _right, _bottomLeft, _bottom, _bottomRight, NSCompositeSourceOver, 1.0f, NO);
NSBezierPath * path = [[NSBezierPath alloc] init];
[path moveToPoint:NSMakePoint(frame.origin.x + 40.0f, frame.origin.y + 66.0f)];
[path setLineWidth:0.0f];
[path lineToPoint:NSMakePoint(frame.size.width - 40.0f, frame.origin.y + 66.0f)];
[path stroke];
[path release];
Now I read the documentation and its says that depending on the View's pixel ratio, and also AA of the current context, the line width may vary for 2.0 pixels... So even I set up the lowst value, 0.0, which in the docs says it will put the smallest line width possible for the device, I get a 2.0 px line. So I guess my problem resides in what exactly the docs says I will have..
this is the constructor of the view's controller:
MagicView * myView = [[MagicView alloc]initWithFrame:NSMakeRect(0.0f, 0.0f, 200.0f, 122.0f)];
[self setView:myView];
[myView release];
so a 200.0f X 122.0f its my view's dimensions, ... then I modify before all the drawing and add this:
CGContextRef myContext = [[NSGraphicsContext currentContext] graphicsPort];
CGContextSetAllowsAntialiasing(myContext, true);
CGContextSaveGState(myContext);
//DRAWING CODE ....
CGContextRestoreGState(myContext);
but nothing seems to work... what am I missing here?
Thanks for your help
Gustavo_______________________________________________
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