Mercurial > hg > svgui
diff layer/LogNumericalScale.cpp @ 1266:a34a2a25907c
Untabify
author | Chris Cannam |
---|---|
date | Thu, 01 Mar 2018 18:02:22 +0000 |
parents | cdaeff1858af |
children | b4cb11ca8233 |
line wrap: on
line diff
--- a/layer/LogNumericalScale.cpp Thu Mar 01 14:43:53 2018 +0000 +++ b/layer/LogNumericalScale.cpp Thu Mar 01 18:02:22 2018 +0000 @@ -28,18 +28,18 @@ int LogNumericalScale::getWidth(LayerGeometryProvider *, - QPainter &paint) + QPainter &paint) { return paint.fontMetrics().width("-000.00") + 10; } void LogNumericalScale::paintVertical(LayerGeometryProvider *v, - const VerticalScaleLayer *layer, - QPainter &paint, - int x0, - double minlog, - double maxlog) + const VerticalScaleLayer *layer, + QPainter &paint, + int x0, + double minlog, + double maxlog) { int n = 10; auto ticks = ScaleTickIntervals::logarithmicAlready({ minlog, maxlog, n }); @@ -51,30 +51,30 @@ for (int i = 0; i < n; ++i) { - int y, ty; + int y, ty; bool drawText = true; - if (i == n-1 && - v->getPaintHeight() < paint.fontMetrics().height() * (n*2)) { - if (layer->getScaleUnits() != "") drawText = false; - } + if (i == n-1 && + v->getPaintHeight() < paint.fontMetrics().height() * (n*2)) { + if (layer->getScaleUnits() != "") drawText = false; + } double val = ticks[i].value; QString label = QString::fromStdString(ticks[i].label); - y = layer->getYForValue(v, val); + y = layer->getYForValue(v, val); - ty = y - paint.fontMetrics().height() + paint.fontMetrics().ascent() + 2; - - if (prevy >= 0 && (prevy - y) < paint.fontMetrics().height()) { - continue; + ty = y - paint.fontMetrics().height() + paint.fontMetrics().ascent() + 2; + + if (prevy >= 0 && (prevy - y) < paint.fontMetrics().height()) { + continue; } - paint.drawLine(w - 5, y, w, y); + paint.drawLine(w - 5, y, w, y); if (drawText) { - paint.drawText(w - paint.fontMetrics().width(label) - 6, - ty, label); + paint.drawText(w - paint.fontMetrics().width(label) - 6, + ty, label); } prevy = y;