comparison layer/LinearNumericalScale.cpp @ 997:296ccd36f626 tony-2.0-integration

Merge through to branch for Tony 2.0
author Chris Cannam
date Thu, 20 Aug 2015 14:54:21 +0100
parents 4fe7a09be0fe
children 5144d7185fb5
comparison
equal deleted inserted replaced
943:788b7623bfca 997:296ccd36f626
21 #include <cmath> 21 #include <cmath>
22 22
23 #include "view/View.h" 23 #include "view/View.h"
24 24
25 int 25 int
26 LinearNumericalScale::getWidth(View *, 26 LinearNumericalScale::getWidth(LayerGeometryProvider *,
27 QPainter &paint) 27 QPainter &paint)
28 { 28 {
29 return paint.fontMetrics().width("-000.00") + 10; 29 return paint.fontMetrics().width("-000.00") + 10;
30 } 30 }
31 31
32 void 32 void
33 LinearNumericalScale::paintVertical(View *v, 33 LinearNumericalScale::paintVertical(LayerGeometryProvider *v,
34 const VerticalScaleLayer *layer, 34 const VerticalScaleLayer *layer,
35 QPainter &paint, 35 QPainter &paint,
36 int x0, 36 int x0,
37 double minf, 37 double minf,
38 double maxf) 38 double maxf)
67 bool drawText = true; 67 bool drawText = true;
68 68
69 double dispval = val; 69 double dispval = val;
70 70
71 if (i == n-1 && 71 if (i == n-1 &&
72 v->height() < paint.fontMetrics().height() * (n*2)) { 72 v->getPaintHeight() < paint.fontMetrics().height() * (n*2)) {
73 if (layer->getScaleUnits() != "") drawText = false; 73 if (layer->getScaleUnits() != "") drawText = false;
74 } 74 }
75 dispval = int(rint(val / round) * round); 75 dispval = int(rint(val / round) * round);
76 76
77 #ifdef DEBUG_TIME_VALUE_LAYER 77 #ifdef DEBUG_TIME_VALUE_LAYER