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,6 +3064,9 @@ void QSynEdit::ensureCursorPosVisibleEx(bool ForceToMiddle)
if (visibleX < leftPos()) if (visibleX < leftPos())
setLeftPos(visibleX); setLeftPos(visibleX);
else if (visibleX > viewWidth() + leftPos() && viewWidth()>0) else if (visibleX > viewWidth() + leftPos() && viewWidth()>0)
if (viewWidth() >= 3*mCharWidth )
setLeftPos(visibleX - viewWidth() + 3*mCharWidth);
else
setLeftPos(visibleX - viewWidth() + mCharWidth); setLeftPos(visibleX - viewWidth() + mCharWidth);
else else
setLeftPos(leftPos()); setLeftPos(leftPos());