• 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
Re: Problem drawing multiple parallel lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem drawing multiple parallel lines


  • Subject: Re: Problem drawing multiple parallel lines
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 25 Jul 2008 15:32:08 -0700

On Jul 25, 2008, at 15:08, Mark Teagarden wrote:

NSBezierPath * apath;
apath = [[NSBezierPath alloc] init];
[[NSColor grayColor] set];
for(i=0;i<12;i++){
[apath setLineWidth:0.15];
[apath moveToPoint: NSMakePoint(borders.origin.x +20+16*i,borders.origin.y+20)];
[apath lineToPoint: NSMakePoint(borders.origin.x +420+16*i,borders.origin.y+320)];
[apath stroke];
}

You're adding a subpath to the path every iteration, so previously drawn subpaths are getting redrawn -- the first one 12 times, the second one 11 times, and so on.


Anti-aliasing, in combination with a fractional line width, is causing the line "spreading" effect.

You need [apath removeAllPoints] inside the loop after [apath stroke], or move [apath stroke] outside the loop.


_______________________________________________

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: Problem drawing multiple parallel lines
      • From: Mark Teagarden <email@hidden>
References: 
 >Problem drawing multiple parallel lines (From: Mark Teagarden <email@hidden>)
 >Re: Problem drawing multiple parallel lines (From: Mark Teagarden <email@hidden>)

  • Prev by Date: Re: Drawing a drop-shadow around a view
  • Next by Date: Re: defer loading window using bundles in XCode 3 Leopard
  • Previous by thread: Re: Problem drawing multiple parallel lines
  • Next by thread: Re: Problem drawing multiple parallel lines
  • Index(es):
    • Date
    • Thread