Re: Slow horizontal scrolling w/NSMutableAttributedStrings
Re: Slow horizontal scrolling w/NSMutableAttributedStrings
- Subject: Re: Slow horizontal scrolling w/NSMutableAttributedStrings
- From: Robert Clair <email@hidden>
- Date: Wed, 25 May 2005 08:10:33 -0400
Your problem is probably that scrolling horizontally triggers layout on
all 30 strings at once. Since you have only a few characters, GACT with
some background colors, in (I presume) a mono-spaced font and a very
simple layout that you know in advance, you could make your own
"sequence string" object that keeps its string data and draws itself by
sequentially copying the pixel representation of the characters to the
screen. You would want to keep track of the visible region and only
actually draw what is visible. It's not as easy as drawing an
attributed string but it's not really that much work.
Another thing to check (although I'd guess that the layout business is
your problem) is that the clip view of your scroll view has
copiesOnScroll set to YES. There was some problem with this on 10.2
when I started but I don't remember whether it didn't want to copy on a
pure horizontal scroll or whether it was a scroll with both a
horizontal and vertical component where it gave up. (I hate scroll bars
and a was making a "hand" tool to drag the view around.) I wound up
doing the pixel copy and redraw of the exposed areas myself (which *is*
a pain to do without artifacts).
You can check this by overriding the drawRect: routine of the clip view
and logging the rect argument to see what is getting redrawn (or use
QuartzDebug).
......Bob Clair
_______________________________________________
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