diff --git a/src/eepp/ui/uicodeeditor.cpp b/src/eepp/ui/uicodeeditor.cpp index 128c1525b..ffeb39492 100644 --- a/src/eepp/ui/uicodeeditor.cpp +++ b/src/eepp/ui/uicodeeditor.cpp @@ -569,6 +569,7 @@ void UICodeEditor::onDocumentLoaded() { DocEvent event( this, mDoc.get(), Event::OnDocumentLoaded ); sendEvent( &event ); invalidateDraw(); + invalidateLongestLineWidth(); } void UICodeEditor::onDocumentChanged() { diff --git a/src/eepp/ui/uiconsole.cpp b/src/eepp/ui/uiconsole.cpp index 00e0510bc..2729f9976 100644 --- a/src/eepp/ui/uiconsole.cpp +++ b/src/eepp/ui/uiconsole.cpp @@ -44,7 +44,7 @@ UIConsole::UIConsole( Font* font, const bool& makeDefaultCommands, const bool& a mFlags |= UI_TAB_STOP | UI_SCROLLABLE | UI_TEXT_SELECTION_ENABLED; setClipType( ClipType::ContentBox ); - setBackgroundColor( 0x201F1F11 ); + setBackgroundColor( 0x201F1FEE ); mDoc.registerClient( this ); registerCommands(); @@ -995,8 +995,11 @@ TextPosition UIConsole::getPositionOnScreen( Vector2f position ) { Float lineHeight = getLineHeight(); auto linesInScreen = linesOnScreen(); auto firstVisibleLine = eemax( mCon.min - mCon.modif, 0 ); - Float startOffset = - getPixelsSize().getHeight() - mPaddingPx.Bottom - linesInScreen * lineHeight; + Float startOffset = getPixelsSize().getHeight() - mPaddingPx.Bottom - + linesInScreen * lineHeight + + ( linesInScreen > (Int64)mCmdLog.size() + ? lineHeight * ( linesInScreen - (Float)mCmdLog.size() ) + : 0.f ); Int64 line = eeclamp( (Int64)eefloor( ( position.y - startOffset ) / lineHeight + 1 ), (Int64)0, (Int64)mCmdLog.size() - 1 ); Int64 fline = eeclamp( firstVisibleLine + line, (Int64)0, (Int64)mCmdLog.size() - 1 );