Re: Getting the visible glyph range
Re: Getting the visible glyph range
- Subject: Re: Getting the visible glyph range
- From: Douglas Davidson <email@hidden>
- Date: Mon, 13 Dec 2004 17:20:31 -0800
On Dec 13, 2004, at 5:09 PM, Nick Zitzmann wrote:
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.
locationForGlyphAtIndex: tells you where the glyph is laid out, not
whether that location is visible. It may be that the glyphs you are
interested in are being drawn but are clipped. You should be able to
determine that if you like from the location and the visible region.
Is the issue here that the glyphs are on the same line but off to the
left or right of the visible region?
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