NSBezierPath Problems
NSBezierPath Problems
- Subject: NSBezierPath Problems
- From: King Chung Huang <email@hidden>
- Date: Sun, 29 Sep 2002 19:27:11 -0600
Hi,
I'm implementing a custom NSControl/NSCell, and I'm having trouble with
drawing the widget in my NSCell's drawWithFrame:cellFrame inView:controlView
function. This is the first time I've used NSBezierPath.
In my code, I've set the line width to 1.0 using [NSBezierPath
setDefaultLineWidth:1.0]. Then, I draw a series of lines. However, some of
my lines are coming up with widths of 2 pixels, while others are 1 pixel as
expected.
For example,
[NSBezierPath strokeLineFromPoint:NSMakePoint(minX + 11, minY)
toPoint:NSMakePoint(minX + 11, minY + 6)];
[NSBezierPath strokeLineFromPoint:NSMakePoint(maxX - 11, minY)
toPoint:NSMakePoint(maxX - 11, minY + 6)];
Is drawing lines that are two pixels wide.
I found a reference to a similar encounter at
<
http://lists.apple.com/archives/cocoa-dev/2001/Jun/14/stupidcodeorbuginnsbe
zie.txt>. However, the only response to the post was a message that a bug
was filed against Quartz.
Another problem I've been having is that the lines that do get drawn seem to
be at < 100% opacity. The code I used to set the color is [[NSColor
colorWithDeviceRed:0.24 green:0.24 blue:0.24 alpha:1.00] set]. However, when
I draw, the DigitalColor Meter clearly shows that the resulting line isn't
nearly as dark as I'd specified, and the areas where the lines overlap are
darker than the rest of the line. If I set the line width to 2.0, then
they're the correct color, but I'm trying to get 1 pixel lines!
Any help or pointers are greatly appreciated. So far, this has been my only
major bump on the road to Cocoa & QuickTime programming.
Thanks,
King Chung Huang
Learning Commons
University of Calgary
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.