Re: Getting the visible glyph range
Re: Getting the visible glyph range
- Subject: Re: Getting the visible glyph range
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 13 Dec 2004 18:09:48 -0700
On Dec 12, 2004, at 1:31 PM, Douglas Davidson wrote:
I'm not sure what the issue is here, but that method is designed to
return a single range covering all of the the glyphs needed to display
for that bounding rect, so it may certainly have some excess. You can
get more detailed information by going through that range line by line
and looking at the locations of the glyphs in it.
I still don't understand why this is happening...
The text view in question is an NSTextView subclass that is being used
as a field editor for an NSTextField subclass. The rectangle returned
from calling -visibleRect on the NSTextView subclass is indeed smaller
than the frame returned from calling -frame on the same text view.
When I try calling -locationForGlyphAtIndex: using a glyph that I know
is off-screen, it returns a point even though I know the glyph is not
being drawn. Even if I pass in a very small NSRect, like an 1x1 size
NSRect, -glyphRangeForBoundingRect:inTextContainer: always returns the
same number.
So how do I get the range of visible glyphs in a field editor? If the
layout manager isn't telling the truth, how do I cycle through each
glyph and figure out whether or not it's really being drawn? I already
tried -notShownAttributeForGlyphAtIndex: and it was always returning
NO.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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