diff --git a/Pdf4QtLibWidgets/sources/pdfdrawwidget.cpp b/Pdf4QtLibWidgets/sources/pdfdrawwidget.cpp index d958112..f4019ad 100644 --- a/Pdf4QtLibWidgets/sources/pdfdrawwidget.cpp +++ b/Pdf4QtLibWidgets/sources/pdfdrawwidget.cpp @@ -645,8 +645,14 @@ void PDFDrawWidgetBase::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::min() : std::numeric_limits::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::min() : std::numeric_limits::max())); + } } } diff --git a/RELEASES.txt b/RELEASES.txt index 7f930eb..98b083a 100644 --- a/RELEASES.txt +++ b/RELEASES.txt @@ -1,4 +1,5 @@ CURRENT: + - Issue #142: Cannot reach the top - Issue #141: Save button in toolbar - Issue #140: New bookmarks created empty? - Issue #139: Changing page layout reset the current page