comparison layer/LogNumericalScale.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 5144d7185fb5
comparison
equal deleted inserted replaced
977:f40ccbf228c2 978:64c2b3a4435a
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;