mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
Profile: prevent a zoom glitch at maximum zoom level
The 'else if' condition in ProfileGraphicsView::wheelEvent() is causing a zoom-in / zoom-out loop at zoomLevel = 10. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
249a1ac170
commit
87dda6661c
1 changed files with 2 additions and 2 deletions
|
@ -78,10 +78,10 @@ void ProfileGraphicsView::wheelEvent(QWheelEvent* event)
|
|||
QPoint toolTipPos = mapFromScene(toolTip->pos());
|
||||
|
||||
double scaleFactor = 1.15;
|
||||
if (event->delta() > 0 && zoomLevel <= 10) {
|
||||
if (event->delta() > 0 && zoomLevel < 10) {
|
||||
scale(scaleFactor, scaleFactor);
|
||||
zoomLevel++;
|
||||
} else if (zoomLevel > 0) {
|
||||
} else if (event->delta() < 0 && zoomLevel > 0) {
|
||||
// Zooming out
|
||||
scale(1.0 / scaleFactor, 1.0 / scaleFactor);
|
||||
zoomLevel--;
|
||||
|
|
Loading…
Reference in a new issue