reset left/top pos after font size changed.
This commit is contained in:
parent
8f4fc16c33
commit
dc4f252b41
|
@ -3148,6 +3148,9 @@ void QSynEdit::updateCaret()
|
||||||
|
|
||||||
void QSynEdit::recalcCharExtent()
|
void QSynEdit::recalcCharExtent()
|
||||||
{
|
{
|
||||||
|
int currentTopRow = mTopPos / mTextHeight;
|
||||||
|
int currentLeftCol = mLeftPos / mCharWidth;
|
||||||
|
|
||||||
FontStyle styles[] = {FontStyle::fsBold, FontStyle::fsItalic, FontStyle::fsStrikeOut, FontStyle::fsUnderline};
|
FontStyle styles[] = {FontStyle::fsBold, FontStyle::fsItalic, FontStyle::fsStrikeOut, FontStyle::fsUnderline};
|
||||||
bool hasStyles[] = {false,false,false,false};
|
bool hasStyles[] = {false,false,false,false};
|
||||||
int size = 4;
|
int size = 4;
|
||||||
|
@ -3222,6 +3225,8 @@ void QSynEdit::recalcCharExtent()
|
||||||
}
|
}
|
||||||
mTextHeight *= mLineSpacingFactor;
|
mTextHeight *= mLineSpacingFactor;
|
||||||
|
|
||||||
|
mTopPos = currentTopRow * mTextHeight;
|
||||||
|
mLeftPos = currentLeftCol * mCharWidth;
|
||||||
onSizeOrFontChanged();
|
onSizeOrFontChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue