Fixed lines cache check.

This commit is contained in:
Martín Lucas Golini
2024-02-26 16:28:07 -03:00
parent cc144c27c1
commit 810ff41c48

View File

@@ -1563,7 +1563,7 @@ Float UICodeEditor::getLineWidth( const Int64& lineIndex ) {
if ( mFont && !mFont->isMonospace() ) {
auto line = mDoc->line( lineIndex );
auto found = mLinesWidthCache.find( lineIndex );
if ( found != mLinesWidthCache.end() && line.getHash() == found->first )
if ( found != mLinesWidthCache.end() && line.getHash() == found->second.first )
return found->second.second;
Float width = getTextWidth( line.getText() ) + getGlyphWidth();
mLinesWidthCache[lineIndex] = { line.getHash(), width };