• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Line Drawing problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Line Drawing problem
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Initial project shell and handling of window pointer
  • Next by Date: Re: Line Drawing problem
  • Previous by thread: Re: Initial project shell and handling of window pointer
  • Next by thread: Re: Line Drawing problem
  • Index(es):
    • Date
    • Thread