Re: finding text to be drawn in NSTextView drawRect
Re: finding text to be drawn in NSTextView drawRect
- Subject: Re: finding text to be drawn in NSTextView drawRect
- From: Andy Lee <email@hidden>
- Date: Thu, 23 May 2002 01:49:23 -0400
At 12:31 AM -0500 5/23/02, Scott Royston wrote:
I'm currently trying to figure out the range of text that needs to
be redrawn (in drawRect) in an NSTextView.
[...]
the only function I could find to get me there was
characterIndexForPoint (in screen coord, no less, ugh). problem is
using a point is very hit or miss. knowing that the text is left to
right helps a little, because I have a better chance of 'hitting' a
character down the left side of the page, but it still doesn't work
very well. before I go further down this path I was hoping somebody
had an easier way.
Just a stab: maybe the methods in NSLayoutManager would give you
better accuracy? I see -characterIndexForGlyphIndex: and a bunch of
-glyphIndexFor... methods.
I don't have deep knowledge of this stuff, but I did have to fiddle
with it a while back to get precise scrolling behavior I wanted.
--Andy
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.