* Source/GSLayoutManager.m

+	(-glyphRangeForCharacterRange:actualCharacterRange:): Handle zero
+	length charRagne at end of text correctly.
This commit is contained in:
fredkiefer 2020-09-11 22:11:31 +02:00
parent 6832eaf1c4
commit c39b49c0d2
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2020-09-11 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSLayoutManager.m
(-glyphRangeForCharacterRange:actualCharacterRange:): Handle zero
length charRagne at end of text correctly.
2020-09-07 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSXib5KeyedUnarchiver.m

View file

@ -1134,16 +1134,16 @@ Fills in all glyph holes up to last. only looking at levels below level
*actualCharRange = charRange;
return NSMakeRange(0, 0);
}
target = charRange.location;
pos = NSMaxRange(charRange) - 1;
[self _generateGlyphsUpToCharacter: pos];
if (glyphs->char_length <= pos)
if (glyphs->char_length <= pos || glyphs->char_length <= target)
{
if (actualCharRange)
*actualCharRange = NSMakeRange([[_textStorage string] length], 0);
return NSMakeRange([self numberOfGlyphs], 0);
}
target = charRange.location;
r = [self _glyphForCharacter: target
index: &i
positions: &pos : &cpos];