minor fix

This commit is contained in:
Roy Qu 2024-03-20 20:57:47 +08:00
parent bcbcc61481
commit d054d9ffce
1 changed files with 4 additions and 1 deletions

View File

@ -3064,7 +3064,10 @@ void QSynEdit::ensureCursorPosVisibleEx(bool ForceToMiddle)
if (visibleX < leftPos())
setLeftPos(visibleX);
else if (visibleX > viewWidth() + leftPos() && viewWidth()>0)
setLeftPos(visibleX - viewWidth() + mCharWidth);
if (viewWidth() >= 3*mCharWidth )
setLeftPos(visibleX - viewWidth() + 3*mCharWidth);
else
setLeftPos(visibleX - viewWidth() + mCharWidth);
else
setLeftPos(leftPos());
// Make sure Y is visible