From efe9bcce02fdf4eaad05ff27d8f3eb96d3958cc3 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Wed, 10 Jul 2019 22:47:53 +0200 Subject: Profile: stop animations on export The plotDive() function had a flag to plot pictures asynchronously. This was used on export. Rename this field to "instant" and disable animations when set. This should make sure that the axes are properly exported. Fixes #2170 Signed-off-by: Berthold Stoeger --- profile-widget/profilewidget2.cpp | 6 +++--- profile-widget/profilewidget2.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index c2514e59e..f3cf31c50 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -548,7 +548,7 @@ void ProfileWidget2::resetZoom() } // Currently just one dive, but the plan is to enable All of the selected dives. -void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPictures, bool plotPicturesSynchronously) +void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPictures, bool instant) { static bool firstCall = true; #ifndef SUBSURFACE_MOBILE @@ -594,7 +594,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict } // special handling for the first time we display things - animSpeed = qPrefDisplay::animation_speed(); + animSpeed = instant ? 0 : qPrefDisplay::animation_speed(); if (firstCall && haveFilesOnCommandLine()) { animSpeed = 0; firstCall = false; @@ -823,7 +823,7 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict if (doClearPictures) clearPictures(); else - plotPicturesInternal(d, plotPicturesSynchronously); + plotPicturesInternal(d, instant); toolTipItem->refresh(mapToScene(mapFromGlobal(QCursor::pos()))); #endif diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index fa3f7f95d..2956b18a5 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -75,7 +75,7 @@ public: ProfileWidget2(QWidget *parent = 0); void resetZoom(); void scale(qreal sx, qreal sy); - void plotDive(const struct dive *d = 0, bool force = false, bool clearPictures = false, bool plotPicturesSynchronously = false); + void plotDive(const struct dive *d = 0, bool force = false, bool clearPictures = false, bool instant = false); void setupItem(AbstractProfilePolygonItem *item, DiveCartesianAxis *vAxis, int vData, int hData, int zValue); void setPrintMode(bool mode, bool grayscale = false); bool getPrintMode(); -- cgit v1.2.3-70-g09d2