Mercurial > hg > svgui
comparison layer/LinearNumericalScale.cpp @ 699:1a1448f7beb2
Pull out colour scale drawing as well
author | Chris Cannam |
---|---|
date | Wed, 04 Dec 2013 13:11:23 +0000 |
parents | ad7623c39396 |
children | 1d526ba11a24 |
comparison
equal
deleted
inserted
replaced
698:ad7623c39396 | 699:1a1448f7beb2 |
---|---|
24 | 24 |
25 int | 25 int |
26 LinearNumericalScale::getWidth(View *v, | 26 LinearNumericalScale::getWidth(View *v, |
27 QPainter &paint) | 27 QPainter &paint) |
28 { | 28 { |
29 return paint.fontMetrics().width("-000.000"); | 29 return paint.fontMetrics().width("-000.00") + 10; |
30 } | 30 } |
31 | 31 |
32 void | 32 void |
33 LinearNumericalScale::paintVertical(View *v, | 33 LinearNumericalScale::paintVertical(View *v, |
34 const VerticalScaleLayer *layer, | 34 const VerticalScaleLayer *layer, |
93 QString label = QString(buffer); | 93 QString label = QString(buffer); |
94 | 94 |
95 paint.drawLine(w - 5, y, w, y); | 95 paint.drawLine(w - 5, y, w, y); |
96 | 96 |
97 if (drawText) { | 97 if (drawText) { |
98 paint.drawText(w - paint.fontMetrics().width(label) - 13, | 98 paint.drawText(w - paint.fontMetrics().width(label) - 6, |
99 ty, label); | 99 ty, label); |
100 } | 100 } |
101 | 101 |
102 prevy = y; | 102 prevy = y; |
103 val += inc; | 103 val += inc; |