From 5538d31f897f5b394f314bf499513d559f56407f Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Tue, 1 Dec 2020 14:45:48 +0200 Subject: Text: Caching the tallest glyphs Reserve one more glyph cache row size so the tallest glyphs fit. --- src/ui/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/text.c b/src/ui/text.c index 25e0da34..3a9b6983 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -332,7 +332,7 @@ static void initCache_Text_(iText *d) { d->cacheRowAllocStep = iMax(2, textSize / 6); /* Allocate initial (empty) rows. These will be assigned actual locations in the cache once at least one glyph is stored. */ - for (int h = d->cacheRowAllocStep; h <= 2 * textSize; h += d->cacheRowAllocStep) { + for (int h = d->cacheRowAllocStep; h <= 2 * textSize + d->cacheRowAllocStep; h += d->cacheRowAllocStep) { pushBack_Array(&d->cacheRows, &(iCacheRow){ .height = 0 }); } d->cacheBottom = 0; -- cgit v1.2.3