From 565e7914f876924ac513f56167441e4620753c1d Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 23 Apr 2024 17:51:30 +0800 Subject: [PATCH] fix: current top line changed after change font size. --- libs/qsynedit/qsynedit/qsynedit.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 1bbb7d55..a6ed8e45 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -3230,9 +3230,12 @@ void QSynEdit::recalcCharExtent() } mTextHeight *= mLineSpacingFactor; - setTopPos(currentTopRow * mTextHeight); - setLeftPos(currentLeftCol * mCharWidth); onSizeOrFontChanged(); + int newTopPos = currentTopRow * mTextHeight; + setTopPos(newTopPos); + if (newTopPos!=mTopPos) + mTopPos = newTopPos; + setLeftPos(currentLeftCol * mCharWidth); } QString QSynEdit::expandAtWideGlyphs(const QString &S)