Profile2: reset the zoom level when a new profile is drawn

If the user has zoomed in but then changes to a new dive,
we may want to reset the scale back to the original value (1.0)
based on the current zoomLevel, so that the profile is not stuck
in zoomed mode.

This patch adds a snippet that resets the QGraphicsView scale,
zoomLevel variable and also the toolTip position.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2014-03-10 17:59:02 +02:00 committed by Dirk Hohndel
parent 324b8cbff1
commit 41cec17cff
2 changed files with 13 additions and 3 deletions

View file

@ -93,6 +93,7 @@ private:
DivePlotDataModel *dataModel;
State currentState;
int zoomLevel;
qreal zoomFactor;
DivePixmapItem *background;
QString backgroundFile;
ToolTipItem *toolTipItem;