reset left/top pos after font size changed.

This commit is contained in:
Roy Qu 2024-03-28 23:08:28 +08:00
parent 8f4fc16c33
commit dc4f252b41
1 changed files with 5 additions and 0 deletions

View File

@ -3148,6 +3148,9 @@ void QSynEdit::updateCaret()
void QSynEdit::recalcCharExtent()
{
int currentTopRow = mTopPos / mTextHeight;
int currentLeftCol = mLeftPos / mCharWidth;
FontStyle styles[] = {FontStyle::fsBold, FontStyle::fsItalic, FontStyle::fsStrikeOut, FontStyle::fsUnderline};
bool hasStyles[] = {false,false,false,false};
int size = 4;
@ -3222,6 +3225,8 @@ void QSynEdit::recalcCharExtent()
}
mTextHeight *= mLineSpacingFactor;
mTopPos = currentTopRow * mTextHeight;
mLeftPos = currentLeftCol * mCharWidth;
onSizeOrFontChanged();
}