mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: remove ProfileWidget2::zoomFactor member
This is a constant, no point in keeping it as a member variable. Contains removal of a pointless #ifdef (guarding against mobile, but code not compiled on mobile), a typo-fix in a comment and replacement of Qt's idiosyncratic qreal by double. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2f9c0c04b5
commit
7051bee7e1
2 changed files with 5 additions and 6 deletions
|
@ -41,16 +41,16 @@
|
||||||
|
|
||||||
// Constant describing at which z-level the thumbnails are located.
|
// Constant describing at which z-level the thumbnails are located.
|
||||||
// We might add more constants here for easier customability.
|
// We might add more constants here for easier customability.
|
||||||
#ifndef SUBSURFACE_MOBILE
|
|
||||||
static const double thumbnailBaseZValue = 100.0;
|
static const double thumbnailBaseZValue = 100.0;
|
||||||
#endif
|
|
||||||
|
// Base of exponential zoom function: one wheel-click will increase the zoom by 15%.
|
||||||
|
static const double zoomFactor = 1.15;
|
||||||
|
|
||||||
ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, double dpr, QWidget *parent) : QGraphicsView(parent),
|
ProfileWidget2::ProfileWidget2(DivePlannerPointsModel *plannerModelIn, double dpr, QWidget *parent) : QGraphicsView(parent),
|
||||||
profileScene(new ProfileScene(dpr, false, false)),
|
profileScene(new ProfileScene(dpr, false, false)),
|
||||||
currentState(INIT),
|
currentState(INIT),
|
||||||
plannerModel(plannerModelIn),
|
plannerModel(plannerModelIn),
|
||||||
zoomLevel(0),
|
zoomLevel(0),
|
||||||
zoomFactor(1.15),
|
|
||||||
#ifndef SUBSURFACE_MOBILE
|
#ifndef SUBSURFACE_MOBILE
|
||||||
toolTipItem(new ToolTipItem()),
|
toolTipItem(new ToolTipItem()),
|
||||||
#endif
|
#endif
|
||||||
|
@ -182,7 +182,7 @@ void ProfileWidget2::resetZoom()
|
||||||
{
|
{
|
||||||
if (!zoomLevel)
|
if (!zoomLevel)
|
||||||
return;
|
return;
|
||||||
const qreal defScale = 1.0 / qPow(zoomFactor, (qreal)zoomLevel);
|
const double defScale = 1.0 / pow(zoomFactor, (double)zoomLevel);
|
||||||
scale(defScale, defScale);
|
scale(defScale, defScale);
|
||||||
zoomLevel = 0;
|
zoomLevel = 0;
|
||||||
}
|
}
|
||||||
|
@ -320,7 +320,7 @@ void ProfileWidget2::scale(qreal sx, qreal sy)
|
||||||
for (PictureEntry &p: pictures)
|
for (PictureEntry &p: pictures)
|
||||||
updateDurationLine(p);
|
updateDurationLine(p);
|
||||||
|
|
||||||
// Since we created new duration lines, we have to update the order in which the thumbnails is painted.
|
// Since we created new duration lines, we have to update the order in which the thumbnails are painted.
|
||||||
updateThumbnailPaintOrder();
|
updateThumbnailPaintOrder();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,6 @@ private:
|
||||||
|
|
||||||
DivePlannerPointsModel *plannerModel; // If null, no planning supported.
|
DivePlannerPointsModel *plannerModel; // If null, no planning supported.
|
||||||
int zoomLevel;
|
int zoomLevel;
|
||||||
qreal zoomFactor;
|
|
||||||
#ifndef SUBSURFACE_MOBILE
|
#ifndef SUBSURFACE_MOBILE
|
||||||
ToolTipItem *toolTipItem;
|
ToolTipItem *toolTipItem;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue