Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 155fa38a authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix potential issue with the TextLayoutCache with glyphs

- there may be a mapping of one char to many glyphs

Change-Id: I48846d176d61dc8d8e513ca144fdf8ad805e63b7
parent d4ad7b49
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -620,7 +620,9 @@ void TextLayoutCacheValue::getGlyphsIndexAndCount(size_t start, size_t count, si
        return;
    }
    *outStartIndex = mLogClusters[start];
    *outGlyphsCount = mLogClusters[start + count - 1] - mLogClusters[start] + 1;
    size_t endIndex = (start + count >= mAdvances.size()) ?
            mGlyphs.size() : mLogClusters[start + count];
    *outGlyphsCount = endIndex - *outStartIndex;
#if DEBUG_GLYPHS
    LOGD("getGlyphsIndexes - start=%d count=%d - startIndex=%d count=%d", start, count,
            *outStartIndex, *outGlyphsCount);