Skip to content

Commit a12234e

Browse files
committed
Improve color management in bidi fonts
1 parent d4a28a6 commit a12234e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

unix/tkUnixBidiFont.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,11 @@ LookUpColor(
618618
if (fontPtr->ncolors < MAX_CACHED_COLORS) {
619619
last2 = -1;
620620
last = fontPtr->ncolors++;
621-
} else {
622-
return NULL;
623621
}
622+
/*
623+
* If cache is full -- 'last' is already the LRU tail slot,
624+
* 'last2' its predecessor, from the search loop above; reuse it.
625+
*/
624626

625627
xcolor.pixel = pixel;
626628
XQueryColor(display, fontPtr->colormap, &xcolor);

0 commit comments

Comments
 (0)