From 235ee4803f9ffc3108e1e00b51afeeb86e8d95a6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 11 Jul 2021 12:06:28 -0700 Subject: [PATCH] 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 --- profile-widget/diveeventitem.cpp | 4 ++++ profile-widget/profilewidget2.cpp | 3 --- 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 #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))