fix: Editor vertical scroller's page step are not correct

This commit is contained in:
Roy Qu 2024-03-25 19:25:49 +08:00
parent bc19b58cd3
commit a24debae6f
1 changed files with 2 additions and 2 deletions

View File

@ -159,7 +159,7 @@ QSynEdit::QSynEdit(QWidget *parent) : QAbstractScrollArea(parent),
connect(verticalScrollBar(),&QScrollBar::valueChanged,
this, &QSynEdit::onScrolled);
connect(verticalScrollBar(), &QAbstractSlider::sliderReleased,
this, qOverload<>(&QSynEdit::ensureLineAlignedWithTop));
this, &QSynEdit::ensureLineAlignedWithTop);
//enable input method
setAttribute(Qt::WA_InputMethodEnabled);
@ -3125,7 +3125,7 @@ void QSynEdit::updateVScrollbar()
nMaxScroll = maxScrollHeight();
nMin = 0;
nMax = std::max(1, nMaxScroll);
nPage = mLinesInWindow;
nPage = mLinesInWindow * mTextHeight;
nPos = mTopPos;
verticalScrollBar()->setMinimum(nMin);
verticalScrollBar()->setMaximum(nMax);