diff options
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index e5212be1e..8ab4aa845 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -206,16 +206,21 @@ void ProfileGraphicsView::showEvent(QShowEvent* event) plot(dive); } +void ProfileGraphicsView::clear() +{ + scene()->clear(); + resetTransform(); + zoomLevel = 0; + toolTip = 0; +} + void ProfileGraphicsView::plot(struct dive *d) { + if (dive == d) + return; - scene()->clear(); - if (dive != d){ - resetTransform(); - zoomLevel = 0; - dive = d; - toolTip = 0; - } + clear(); + dive = d; if(!isVisible() || !dive){ return; |