Re: behind the scenes of -drawInRect:
Re: behind the scenes of -drawInRect:
- Subject: Re: behind the scenes of -drawInRect:
- From: Douglas Davidson <email@hidden>
- Date: Fri, 26 May 2006 16:45:03 -0700
On May 26, 2006, at 4:35 PM, Joshua Scott Emmons wrote:
Ah. I was under the impression that -[NSAttributedString
drawInRect:] was lighter weight. But now that you mention it, it
makes sense that it would have to do all the things I'm doing with
NSLayoutManager anyway just to wrap and layout the text in the
given rect, wouldn't it? Is -drawInRect: just a convenience for
setting up and tearing down NSLayoutManager et al. on the fly?
The string drawing methods like drawInRect: are intended primarily
for convenience. However, they are not purely synonymous with
setting up a layout manager, causing layout, and using it to draw;
they have some optimized paths for particular situations, and they
are often quite efficient. Nevertheless, if you already have a
layout manager with the text laid out in it, then drawing with that
layout manager should be at least as fast as using drawInRect: for
any situation I can think of.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden