Stupid code or bug in NSBezierPath (or Quartz who knows ?)
Stupid code or bug in NSBezierPath (or Quartz who knows ?)
- Subject: Stupid code or bug in NSBezierPath (or Quartz who knows ?)
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 14 Jun 2001 16:22:32 +0200
Is it my eyes or there's a bug in the NSBezierPath or Quartz code (a big
one) ?
I have a stupid custom subclass of NSView which is drawing some lines
with the following code:
- (void) drawRect:(NSRect) frame
{
NSRect localFrame=[self frame];
NSGraphicsContext * tContext;
tContext=[NSGraphicsContext currentContext];
[tContext setShouldAntialias:NO]; // <- Antialiasing Off
[[NSColor blackColor] set];
// Remind me to post a bug report for the bug in the NSBezierPath
Documentation + (void) setLineWidth doesn't exist.
[NSBezierPath setDefaultLineWidth:1.0]; // <- Line Width = 1 pixel
[NSBezierPath strokeRect:localFrame];
[NSBezierPath strokeLineFromPoint:NSMakePoint(0,0)
toPoint:NSMakePoint(50,50)]; // To check Antialias is Off
}
And guess what I'm getting a frame rect and a line 2 pixels wide (using
Pixie and my eyes).
So I tried with [NSBezierPath setDefaultLineWidth:0.5];
same result 2 pixels wide.
So I tried with [NSBezierPath setDefaultLineWidth:3];
and get 3 pixels wide
So I tried with [NSBezierPath setDefaultLineWidth:2];
and get 2 pixels wide
So I tried with [NSBezierPath setDefaultLineWidth:10];
and get 10 pixels wide
Any idea pointing to a bug on my side or should I begin readying my
inflatable hammer ?