On Sep 13, 2012, at 7:24 PM, Graham Cox <[email protected]> wrote:
> > On 14/09/2012, at 7:56 AM, Koen van der Drift <[email protected]> > wrote: > >> >> On Sep 13, 2012, at 1:01 PM, Andy Lee <[email protected]> wrote: >> >>>> >>>> Is that possible, since they all have different begin and end points? >>> >>> Yes. An NSBezierPath can contain multiple unconnected paths. >> >> This did the trick, I created all lines within the same NSBezierPath, and >> when they overlap, the color remained the same. No need to set any blending >> or composition modes. Saved me also a lot of creating NSBezierPath instances >> and drawing them one at a time. > > > Combining paths into a single NSBezierPath means those paths are treated as a > single object for a drawing operation, and intersections are rendered > accordingly. However, this behaviour doesn't come at no cost - the code has > to find those intersections and deal with them by ensuring that the same > pixels are not rendered twice. While usually faster than looping over > separate paths, this intersection finding can potentially slows things down a > lot. > > --Graham > Hi Graham As always, I appreciate your input, especially on questions regarding drawing stuff. In my case so far I have not yet seen any slow down, since only a few lines *may* intersect. Luckily it doesn't look like a spiderweb. - Koen. _______________________________________________ Cocoa-dev mailing list ([email protected]) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
