Line Drawing problem
Line Drawing problem
- Subject: Line Drawing problem
- From: Dale Satterfield <email@hidden>
- Date: Sun, 03 Jul 2011 13:48:59 -0700
I am trying to write an application that needs to plot some data and draw lines between the points.
The code I am using is:
for(index = 0; index < (limit - 1); index++)
{
[NSBezierPath setDefaultLineWidth: 4 * MIN(unitSize.height,
unitSize.width)];
[delegate dataPointAtIndex: index x: &x y: &y];
[delegate dataPointAtIndex: index+1 x: &x1 y: &y1];
[NSBezierPath strokeLineFromPoint:NSMakePoint(x, y) toPoint:NSMakePoint(x1, y1)];
}
Lines with sufficient slope always draw in Black(the set color), and the specified width. However if the slope is low enough they print thinner, and in a different color.
This is an example:
Can't find any discussion of this effect in any books or online documentation. Would appreciate any suggestions. I am trying to use this project to learn Cocoa and Objective-C
so am still not familiar with all the ins and outs.
Dale Satterfield
email@hidden
_______________________________________________
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