When steping forward at the end of the glyph runs, correctly handle the case where the current run is extended.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16345 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-04-03 18:31:25 +00:00
parent 60c44310e2
commit 74704f51e3
3 changed files with 25 additions and 24 deletions

View file

@ -1,3 +1,10 @@
2003-04-03 20:28 Alexander Malmberg <alexander@malmberg.org>
* Headers/gnustep/gui/GSLayoutManager_internal.h,
Source/GSLayoutManager.m: When stepping forward at the end of the
glyph runs, correctly handle the case where the current run is
extended.
2003-04-02 15:26 Alexander Malmberg <alexander@malmberg.org>
* Source/GSHorizontalTypesetter.m: Tweak glyph caching parameters

View file

@ -246,18 +246,23 @@ the last run and i==r->head.glyph_length. */
#define GLYPH_STEP_FORWARD(r, i, pos, cpos) \
{ \
i++; \
while (i==r->head.glyph_length) \
while (i == r->head.glyph_length) \
{ \
if (!r->head.next || !r->head.next->complete) \
{ \
if (cpos+r->head.char_length==[_textStorage length]) \
if (cpos + r->head.char_length == [_textStorage length]) \
break; \
[self _generateGlyphsUpToCharacter: cpos+r->head.char_length]; \
/* This call might lead to the current run being extended, so \
we make sure that we check r->head.glyph_length again. */ \
[self _generateGlyphsUpToCharacter: cpos + r->head.char_length]; \
} \
else \
{ \
pos += r->head.glyph_length; \
cpos += r->head.char_length; \
r = (glyph_run_t *)r->head.next; \
i = 0; \
} \
pos+=r->head.glyph_length; \
cpos+=r->head.char_length; \
r=(glyph_run_t *)r->head.next; \
i=0; \
} \
}

View file

@ -498,7 +498,7 @@ static glyph_run_t *run_insert(glyph_run_head_t **context)
pos += new->head.char_length;
}
// [self _glyphDumpRuns];
[self _sanityChecks];
}
@ -858,22 +858,11 @@ static glyph_run_t *run_insert(glyph_run_head_t **context)
cadj = cpos;
while (r2->glyphs[i].char_offset + cadj == j)
{
i++;
while (i == r2->head.glyph_length)
GLYPH_STEP_FORWARD(r2,i,adj,cadj)
if (i==r2->head.glyph_length)
{
if (!r2->head.next || !r2->head.next->complete)
{
if (cadj + r2->head.char_length == [_textStorage length])
{
last = cadj + r2->head.char_length;
goto found;
}
[self _generateGlyphsUpToCharacter: cadj + r2->head.char_length];
}
adj += r2->head.glyph_length;
cadj += r2->head.char_length;
r2 = (glyph_run_t *)r2->head.next;
i = 0;
last = cadj + r2->head.char_length;
goto found;
}
}
last = r2->glyphs[i].char_offset + cadj;
@ -998,7 +987,7 @@ places where we switch.
*actualRange = range;
// printf("range=(%i+%i) lengthChange=%i\n", range.location, range.length, lengthChange);
// printf("\n +++ range=(%i+%i) lengthChange=%i\n", range.location, range.length, lengthChange);
[self _sanityChecks];
// [self _glyphDumpRuns];