Mercurial > hg > svgui
diff layer/SliceLayer.cpp @ 978:64c2b3a4435a 3.0-integration
Merge from branch osx-retina
author | Chris Cannam |
---|---|
date | Fri, 26 Jun 2015 14:10:40 +0100 |
parents | 4fe7a09be0fe |
children | ee01a4062747 |
line wrap: on
line diff
--- a/layer/SliceLayer.cpp Fri Jun 26 14:10:18 2015 +0100 +++ b/layer/SliceLayer.cpp Fri Jun 26 14:10:40 2015 +0100 @@ -92,14 +92,14 @@ } QString -SliceLayer::getFeatureDescription(View *v, QPoint &p) const +SliceLayer::getFeatureDescription(LayerGeometryProvider *v, QPoint &p) const { int minbin, maxbin, range; return getFeatureDescriptionAux(v, p, true, minbin, maxbin, range); } QString -SliceLayer::getFeatureDescriptionAux(View *v, QPoint &p, +SliceLayer::getFeatureDescriptionAux(LayerGeometryProvider *v, QPoint &p, bool includeBinDescription, int &minbin, int &maxbin, int &range) const { @@ -108,7 +108,7 @@ if (!m_sliceableModel) return ""; int xorigin = m_xorigins[v]; - int w = v->width() - xorigin - 1; + int w = v->getPaintWidth() - xorigin - 1; int mh = m_sliceableModel->getHeight(); minbin = getBinForX(p.x() - xorigin, mh, w); @@ -226,7 +226,7 @@ } double -SliceLayer::getYForValue(double value, const View *v, double &norm) const +SliceLayer::getYForValue(double value, const LayerGeometryProvider *v, double &norm) const { norm = 0.0; @@ -276,7 +276,7 @@ } double -SliceLayer::getValueForY(double y, const View *v) const +SliceLayer::getValueForY(double y, const LayerGeometryProvider *v) const { double value = 0.0; @@ -313,7 +313,7 @@ } void -SliceLayer::paint(View *v, QPainter &paint, QRect rect) const +SliceLayer::paint(LayerGeometryProvider *v, QPainter &paint, QRect rect) const { if (!m_sliceableModel || !m_sliceableModel->isOK() || !m_sliceableModel->isReady()) return; @@ -334,11 +334,11 @@ paint.setPen(getBaseQColor()); int xorigin = getVerticalScaleWidth(v, true, paint) + 1; - int w = v->width() - xorigin - 1; + int w = v->getPaintWidth() - xorigin - 1; m_xorigins[v] = xorigin; // for use in getFeatureDescription - int yorigin = v->height() - 20 - paint.fontMetrics().height() - 7; + int yorigin = v->getPaintHeight() - 20 - paint.fontMetrics().height() - 7; int h = yorigin - paint.fontMetrics().height() - 8; m_yorigins[v] = yorigin; // for getYForValue etc @@ -501,7 +501,7 @@ } int -SliceLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const +SliceLayer::getVerticalScaleWidth(LayerGeometryProvider *, bool, QPainter &paint) const { if (m_energyScale == LinearScale || m_energyScale == AbsoluteScale) { return std::max(paint.fontMetrics().width("0.0") + 13, @@ -513,7 +513,7 @@ } void -SliceLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect rect) const +SliceLayer::paintVerticalScale(LayerGeometryProvider *v, bool, QPainter &paint, QRect rect) const { double thresh = m_threshold; if (m_energyScale != LinearScale && m_energyScale != AbsoluteScale) { @@ -523,7 +523,7 @@ // int h = (rect.height() * 3) / 4; // int y = (rect.height() / 2) - (h / 2); - int yorigin = v->height() - 20 - paint.fontMetrics().height() - 6; + int yorigin = v->getPaintHeight() - 20 - paint.fontMetrics().height() - 6; int h = yorigin - paint.fontMetrics().height() - 8; if (h < 0) return;