Try to make sure each container gets at least one line frag rect.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15747 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
alexm 2003-01-28 17:00:15 +00:00
parent d51bd04211
commit 2c98ae0b50
2 changed files with 21 additions and 2 deletions

View file

@ -1,9 +1,17 @@
2003-01-28 17:55 Alexander Malmberg <alexander@malmberg.org>
* Source/GSLayoutManager.m (-layoutLineNewParagraph:): Try to make
sure each container gets at least one line frag rect.
* Source/NSTextView: Avoid making calls to the layout manager with
invalid arguments.
2003-01-28 17:40 Alexander Malmberg <alexander@malmberg.org> 2003-01-28 17:40 Alexander Malmberg <alexander@malmberg.org>
* Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m: * Source/GSHorizontalTypesetter.m, Source/GSLayoutManager.m:
Whitespace cleanups and comments. Whitespace cleanups and comments.
Source/NSLayoutManager.m: (-rectArrayForGlyphRange: * Source/NSLayoutManager.m: (-rectArrayForGlyphRange:
withinSelectedGlyphRange:inTextContainer:rectCount:): Give better withinSelectedGlyphRange:inTextContainer:rectCount:): Give better
error message for an invalid glyph range. error message for an invalid glyph range.

View file

@ -408,7 +408,18 @@ restart:
line_frags[num_line_frags - 1].rect = rect; line_frags[num_line_frags - 1].rect = rect;
} }
if (!num_line_frags) if (!num_line_frags)
return 1; {
if (curPoint.y == 0.0 &&
line_height > [curTextContainer containerSize].height)
{
/* Try to make sure each container contains at least one line frag
rect by shrinking our line height. */
line_height = [curTextContainer containerSize].height;
max_line_height = line_height;
goto restart;
}
return 1;
}
{ {
unsigned int i = 0; unsigned int i = 0;