Mercurial > hg > svgui
diff layer/TimeRulerLayer.cpp @ 918:4fe7a09be0fe osx-retina
Many fixes for the previous stuff
author | Chris Cannam |
---|---|
date | Tue, 17 Mar 2015 16:56:03 +0000 |
parents | 94e4952a6774 |
children | a5488775f880 |
line wrap: on
line diff
--- a/layer/TimeRulerLayer.cpp Tue Mar 17 16:33:51 2015 +0000 +++ b/layer/TimeRulerLayer.cpp Tue Mar 17 16:56:03 2015 +0000 @@ -49,7 +49,7 @@ } bool -TimeRulerLayer::snapToFeatureFrame(View *v, sv_frame_t &frame, +TimeRulerLayer::snapToFeatureFrame(LayerGeometryProvider *v, sv_frame_t &frame, int &resolution, SnapType snap) const { if (!m_model) { @@ -141,7 +141,7 @@ } int -TimeRulerLayer::getMajorTickSpacing(View *v, bool &quarterTicks) const +TimeRulerLayer::getMajorTickSpacing(LayerGeometryProvider *v, bool &quarterTicks) const { // return value is in milliseconds @@ -158,7 +158,7 @@ RealTime rtStart = RealTime::frame2RealTime(startFrame, sampleRate); RealTime rtEnd = RealTime::frame2RealTime(endFrame, sampleRate); - int count = v->width() / minPixelSpacing; + int count = v->getPaintWidth() / minPixelSpacing; if (count < 1) count = 1; RealTime rtGap = (rtEnd - rtStart) / count; @@ -287,11 +287,11 @@ } paint.setPen(greyColour); - paint.drawLine(x, 0, x, v->height()); + paint.drawLine(x, 0, x, v->getPaintHeight()); paint.setPen(getBaseQColor()); paint.drawLine(x, 0, x, 5); - paint.drawLine(x, v->height() - 6, x, v->height() - 1); + paint.drawLine(x, v->getPaintHeight() - 6, x, v->getPaintHeight() - 1); int y; switch (m_labelHeight) { @@ -300,10 +300,10 @@ y = 6 + metrics.ascent(); break; case LabelMiddle: - y = v->height() / 2 - metrics.height() / 2 + metrics.ascent(); + y = v->getPaintHeight() / 2 - metrics.height() / 2 + metrics.ascent(); break; case LabelBottom: - y = v->height() - metrics.height() + metrics.ascent() - 6; + y = v->getPaintHeight() - metrics.height() + metrics.ascent() - 6; } if (v->getViewManager() && v->getViewManager()->getOverlayMode() != @@ -344,14 +344,14 @@ if (ticks == 10) { if ((i % 2) == 1) { if (i == 5) { - paint.drawLine(x, 0, x, v->height()); + paint.drawLine(x, 0, x, v->getPaintHeight()); } else sz = 3; } else { sz = 7; } } paint.drawLine(x, 0, x, sz); - paint.drawLine(x, v->height() - sz - 1, x, v->height() - 1); + paint.drawLine(x, v->getPaintHeight() - sz - 1, x, v->getPaintHeight() - 1); } ms += incms;