aboutsummaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-11 12:06:28 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-07-11 13:02:43 -0700
commit235ee4803f9ffc3108e1e00b51afeeb86e8d95a6 (patch)
treee868fde4e6e3b2ec37b19d73f448b2c455be186f /profile-widget
parentcfc87e9da3f5fb14c81032acd4c229cd97b97f87 (diff)
downloadsubsurface-235ee4803f9ffc3108e1e00b51afeeb86e8d95a6.tar.gz
printing: remote incorrect scaling of event icons
It appears that this well intended change in commit 52aa7d83b6 ("Increase event icon size in print mode") actually causes the scaling of the event icons to be generally wrong. This removes the hard 4* scaling and also adds some debugging output in verbose mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/diveeventitem.cpp4
-rw-r--r--profile-widget/profilewidget2.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/profile-widget/diveeventitem.cpp b/profile-widget/diveeventitem.cpp
index f1f0f8016..e61182051 100644
--- a/profile-widget/diveeventitem.cpp
+++ b/profile-widget/diveeventitem.cpp
@@ -11,6 +11,7 @@
#include "core/membuffer.h"
#include "core/sample.h"
#include "core/subsurface-string.h"
+#include <QDebug>
#define DEPTH_NOT_FOUND (-2342)
@@ -50,6 +51,7 @@ struct event *DiveEventItem::getEventMutable()
void DiveEventItem::setupPixmap(struct gasmix lastgasmix, double fontPrintScale)
{
+ extern int verbose;
const IconMetrics& metrics = defaultIconMetrics();
#ifndef SUBSURFACE_MOBILE
int sz_bigger = metrics.sz_med + metrics.sz_small; // ex 40px
@@ -65,6 +67,8 @@ void DiveEventItem::setupPixmap(struct gasmix lastgasmix, double fontPrintScale)
#endif
sz_bigger = lrint(sz_bigger * fontPrintScale);
int sz_pix = sz_bigger/2; // ex 20px
+ if (verbose)
+ qDebug() << __FUNCTION__ << "fontPrintScale" << fontPrintScale << "metrics" << metrics.sz_med << metrics.sz_small << "sz_bigger" << sz_bigger;
#define EVENT_PIXMAP(PIX) QPixmap(QString(PIX)).scaled(sz_pix, sz_pix, Qt::KeepAspectRatio, Qt::SmoothTransformation)
#define EVENT_PIXMAP_BIGGER(PIX) QPixmap(QString(PIX)).scaled(sz_bigger, sz_bigger, Qt::KeepAspectRatio, Qt::SmoothTransformation)
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 930df1267..9e307ef39 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -723,9 +723,6 @@ void ProfileWidget2::plotDive(const struct dive *dIn, int dcIn, bool doClearPict
#endif
DiveEventItem *item = new DiveEventItem(d, event, lastgasmix, dataModel, timeAxis, profileYAxis, animSpeed, getFontPrintScale());
item->setZValue(2);
-#ifndef SUBSURFACE_MOBILE
- item->setScale(printMode ? 4 :1);
-#endif
scene()->addItem(item);
eventItems.push_back(item);
if (event_is_gaschange(event))