mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Issue #142: Cannot reach the top
This commit is contained in:
@ -645,8 +645,14 @@ void PDFDrawWidgetBase<BaseWidget>::wheelEvent(QWheelEvent* event)
|
||||
// We must move to another block (we are in block mode)
|
||||
bool up = scrollByPixels.y() > 0;
|
||||
|
||||
m_widget->getVerticalScrollbar()->setValue(m_widget->getVerticalScrollbar()->value() + (up ? -1 : 1));
|
||||
proxy->scrollByPixels(QPoint(0, up ? std::numeric_limits<int>::min() : std::numeric_limits<int>::max()));
|
||||
QScrollBar* verticalScrollbar = m_widget->getVerticalScrollbar();
|
||||
const int newValue = verticalScrollbar->value() + (up ? -1 : 1);
|
||||
|
||||
if (newValue >= verticalScrollbar->minimum() && newValue <= verticalScrollbar->maximum())
|
||||
{
|
||||
verticalScrollbar->setValue(newValue);
|
||||
proxy->scrollByPixels(QPoint(0, up ? std::numeric_limits<int>::min() : std::numeric_limits<int>::max()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user