diff --git a/src/eepp/graphics/text.cpp b/src/eepp/graphics/text.cpp index 9379b3d99..3c2d7729f 100644 --- a/src/eepp/graphics/text.cpp +++ b/src/eepp/graphics/text.cpp @@ -1336,7 +1336,7 @@ Int32 Text::findCharacterFromPos( const Vector2i& pos, bool returnNearest, Font* }; if ( fpos.y >= charTop && fpos.y <= charBottom ) { - auto findNextInsertionIndex = [&layout, sg, i, sgs, tSize, sp]() -> Int32 { + auto findNextInsertionIndex = [&]() -> Int32 { if ( layout->isRTL() ) { if ( i > 0 ) { for ( auto j = i - 1; j >= 0; j-- ) { diff --git a/src/eepp/graphics/textlayout.cpp b/src/eepp/graphics/textlayout.cpp index 71dd466a0..70324a882 100644 --- a/src/eepp/graphics/textlayout.cpp +++ b/src/eepp/graphics/textlayout.cpp @@ -13,7 +13,7 @@ namespace EE::Graphics { -using LRULayoutCache = LRUCache<2048, Uint64, TextLayout::Cache>; +using LRULayoutCache = LRUCache<8192, Uint64, TextLayout::Cache>; #ifdef EE_TEXT_SHAPER_ENABLED diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 65d2d4e1e..d69efbc79 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -4212,6 +4212,7 @@ void UICodeEditor::drawLineText( const Int64& line, Vector2f position, const Flo } } } else { + bool getChunkHints = !Text::canSkipShaping( drawHints ) && tokens.size() > 8192; for ( const auto& token : tokens ) { String::View text = strLine.view(); if ( pos < strLine.size() && !( pos == 0 && text.size() == token.len ) ) { @@ -4281,28 +4282,35 @@ void UICodeEditor::drawLineText( const Int64& line, Vector2f position, const Flo Int64 totalChars = curCharsWidth - start; Int64 end = eemin( totalChars, minimumCharsToCoverScreen ); if ( curCharsWidth >= charsToVisible ) { + String::View subText( text.substr( start, end ) ); size = Text::draw( - text.substr( start, end ), + subText, { position.x + start * getGlyphWidth(), position.y + lineOffset }, - fontStyle, mTabWidth, drawHints, mTextDirection, - whitespaceDisplayConfig ); + fontStyle, mTabWidth, + getChunkHints ? String::getTextHints( subText ) : drawHints, + mTextDirection, whitespaceDisplayConfig ); if ( minimumCharsToCoverScreen == end ) break; } } else { - size = Text::draw( text.substr( 0, eemin( curCharsWidth, maxWidth ) ), - { position.x, position.y + lineOffset }, fontStyle, - mTabWidth, drawHints, mTextDirection, - whitespaceDisplayConfig ); + String::View subText( text.substr( 0, eemin( curCharsWidth, maxWidth ) ) ); + size = Text::draw( + subText, { position.x, position.y + lineOffset }, fontStyle, mTabWidth, + getChunkHints ? String::getTextHints( subText ) : drawHints, + mTextDirection, whitespaceDisplayConfig ); } } else { - size = - Text::draw( text, { position.x, position.y + lineOffset }, fontStyle, - mTabWidth, drawHints, mTextDirection, whitespaceDisplayConfig ); + size = Text::draw( text, { position.x, position.y + lineOffset }, fontStyle, + mTabWidth, + getChunkHints ? String::getTextHints( text ) : drawHints, + mTextDirection, whitespaceDisplayConfig ); } if ( !isMonospace ) textWidth = size.getWidth(); + + if ( position.x > mScreenPos.x + mSize.getWidth() ) + break; } else if ( position.x > mScreenPos.x + mSize.getWidth() ) { break; } diff --git a/src/eepp/window/backend/SDL3/inputsdl3.cpp b/src/eepp/window/backend/SDL3/inputsdl3.cpp index ecf6285d9..6662c6027 100644 --- a/src/eepp/window/backend/SDL3/inputsdl3.cpp +++ b/src/eepp/window/backend/SDL3/inputsdl3.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #ifdef EE_BACKEND_SDL3