(-layoutGlyphsInLayoutManager:inTextContainer:startingAtGlyphIndex:previousLineFragmentRect:nextGlyphIndex:numberOfLineFragments:): Determine the initial value for newParagraph correctly.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15992 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-02-18 00:35:18 +00:00
parent 7435220c32
commit e262df5bbd

View file

@ -1035,9 +1035,28 @@ NS_DURING
[self _cacheClear];
newParagraph = NO;
/*
-layoutLineNewParagraph: needs to know if the starting glyph is the
first glyph of a paragraph so it can apply eg. -firstLineHeadIndent and
paragraph spacing properly.
*/
if (!curGlyph)
newParagraph = YES;
{
newParagraph = YES;
}
else
{
unsigned char chi;
unichar ch;
chi = [curLayoutManager characterRangeForGlyphRange: NSMakeRange(curGlyph - 1, 1)
actualGlyphRange: NULL].location;
ch = [[curTextStorage string] characterAtIndex: chi];
if (ch == '\n')
newParagraph = YES;
else
newParagraph = NO;
}
ret = 0;
curPoint = NSMakePoint(0,NSMaxY(previousLineFragRect));