comparison layer/LogNumericalScale.cpp @ 1045:f535f6e5dbb0 alignment-simple

Merge in from SV 3.0-integration branches
author Chris Cannam
date Wed, 02 Mar 2016 17:25:27 +0000
parents 4fe7a09be0fe
children 5144d7185fb5
comparison
equal deleted inserted replaced
976:f2c63ec85901 1045:f535f6e5dbb0
25 #include "view/View.h" 25 #include "view/View.h"
26 26
27 //#define DEBUG_TIME_VALUE_LAYER 1 27 //#define DEBUG_TIME_VALUE_LAYER 1
28 28
29 int 29 int
30 LogNumericalScale::getWidth(View *, 30 LogNumericalScale::getWidth(LayerGeometryProvider *,
31 QPainter &paint) 31 QPainter &paint)
32 { 32 {
33 return paint.fontMetrics().width("-000.00") + 10; 33 return paint.fontMetrics().width("-000.00") + 10;
34 } 34 }
35 35
36 void 36 void
37 LogNumericalScale::paintVertical(View *v, 37 LogNumericalScale::paintVertical(LayerGeometryProvider *v,
38 const VerticalScaleLayer *layer, 38 const VerticalScaleLayer *layer,
39 QPainter &paint, 39 QPainter &paint,
40 int x0, 40 int x0,
41 double minlog, 41 double minlog,
42 double maxlog) 42 double maxlog)
77 77
78 int y, ty; 78 int y, ty;
79 bool drawText = true; 79 bool drawText = true;
80 80
81 if (i == n-1 && 81 if (i == n-1 &&
82 v->height() < paint.fontMetrics().height() * (n*2)) { 82 v->getPaintHeight() < paint.fontMetrics().height() * (n*2)) {
83 if (layer->getScaleUnits() != "") drawText = false; 83 if (layer->getScaleUnits() != "") drawText = false;
84 } 84 }
85 85
86 double dispval = LogRange::unmap(val); 86 double dispval = LogRange::unmap(val);
87 dispval = floor(dispval / round) * round; 87 dispval = floor(dispval / round) * round;