(_insertionPointRectForCharacterIndex:textContainer:): Use

default font height for insertion point height if there is
no characters.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24571 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
stoyan 2007-02-14 17:42:07 +00:00
parent 65f76b0d62
commit 91dc3d9b17

View file

@ -808,12 +808,12 @@ has the same y origin and height as the line frag rect it is in.
} }
glyph_index = [self numberOfGlyphs] - 1; glyph_index = [self numberOfGlyphs] - 1;
if (glyph_index == (unsigned int)-1) if (glyph_index == (unsigned int)-1)
{ { /* No information is available. Get default font height. */
/* No information is available. The best we can do is guess. */ NSFont *f = [_typingAttributes objectForKey:NSFontAttributeName];
/* will be -1 if there are no text containers */ /* will be -1 if there are no text containers */
*textContainer = num_textcontainers - 1; *textContainer = num_textcontainers - 1;
return NSMakeRect(1, 1, 1, 15); return NSMakeRect(0, 0, 1, [f boundingRectForFont].size.height);
} }
fraction_through = 1.0; fraction_through = 1.0;
} }