# HG changeset patch # User Chris Cannam # Date 1542207844 0 # Node ID 9ea55113732997fa30aedf37b6b2605fc530916f # Parent 2e316a724336ff217168a3272061af5a9d21b821 Fix some incorrect pixel scaling diff -r 2e316a724336 -r 9ea551137329 layer/SpectrumLayer.cpp --- a/layer/SpectrumLayer.cpp Wed Nov 14 14:29:08 2018 +0000 +++ b/layer/SpectrumLayer.cpp Wed Nov 14 15:04:04 2018 +0000 @@ -802,10 +802,10 @@ if (illuminateThis) { int labelY = v->getPaintHeight() - getHorizontalScaleHeight(v, paint) - - paint.fontMetrics().height() * 3; + paint.fontMetrics().height() * 4; QString text = tr("%1 Hz").arg(freq); int lw = paint.fontMetrics().width(text); - int gap = ViewManager::scalePixelSize(3); + int gap = ViewManager::scalePixelSize(v->getXForViewX(3)); double half = double(gap)/2.0; int labelX = x - lw - gap; if (labelX < getVerticalScaleWidth(v, false, paint)) { diff -r 2e316a724336 -r 9ea551137329 view/Pane.cpp --- a/view/Pane.cpp Wed Nov 14 14:29:08 2018 +0000 +++ b/view/Pane.cpp Wed Nov 14 15:04:04 2018 +0000 @@ -27,7 +27,6 @@ #include "layer/WaveformLayer.h" #include "layer/TimeRulerLayer.h" #include "layer/PaintAssistant.h" -#include "ViewProxy.h" // GF: added so we can propagate the mouse move event to the note layer for context handling. #include "layer/LayerFactory.h" @@ -881,27 +880,29 @@ void Pane::drawLayerNames(QRect r, QPainter &paint) { - ViewProxy proxy(this, effectiveDevicePixelRatio()); - int fontHeight = paint.fontMetrics().height(); int fontAscent = paint.fontMetrics().ascent(); int lly = height() - 6; + + int zoomWheelSkip = 0, horizontalScaleSkip = 0; + if (m_manager->getZoomWheelsEnabled()) { - lly -= m_manager->scalePixelSize(20); + zoomWheelSkip = m_manager->scalePixelSize(20); } for (LayerList::iterator i = m_layerStack.end(); i != m_layerStack.begin();) { --i; - int hsh = (*i)->getHorizontalScaleHeight(&proxy, paint); - if (hsh > 0) { - lly -= hsh; + horizontalScaleSkip = (*i)->getHorizontalScaleHeight(this, paint); + if (horizontalScaleSkip > 0) { break; } if ((*i)->isLayerOpaque()) { break; } } + + lly -= std::max(zoomWheelSkip, horizontalScaleSkip); if (r.y() + r.height() < lly - int(m_layerStack.size()) * fontHeight) { return; @@ -1844,8 +1845,7 @@ Layer *interactionLayer = getInteractionLayer(); if (interactionLayer && !(interactionLayer->hasTimeXAxis())) { SVDEBUG << "Interaction layer does not have time X axis - delegating to it to decide what to do" << endl; - ViewProxy proxy(this, effectiveDevicePixelRatio()); - interactionLayer->zoomToRegion(&proxy, r); + interactionLayer->zoomToRegion(this, r); return; }