comparison layer/PaintAssistant.cpp @ 1266:a34a2a25907c

Untabify
author Chris Cannam
date Thu, 01 Mar 2018 18:02:22 +0000
parents dc6457ac4d07
children 6e35062fc10a
comparison
equal deleted inserted replaced
1265:6e724c81f18f 1266:a34a2a25907c
27 #include <iostream> 27 #include <iostream>
28 #include <cmath> 28 #include <cmath>
29 29
30 void 30 void
31 PaintAssistant::paintVerticalLevelScale(QPainter &paint, QRect rect, 31 PaintAssistant::paintVerticalLevelScale(QPainter &paint, QRect rect,
32 double minVal, double maxVal, 32 double minVal, double maxVal,
33 Scale scale, int &mult, 33 Scale scale, int &mult,
34 std::vector<int> *vy) 34 std::vector<int> *vy)
35 { 35 {
36 static double meterdbs[] = { -40, -30, -20, -15, -10, 36 static double meterdbs[] = { -40, -30, -20, -15, -10,
37 -5, -3, -2, -1, -0.5, 0 }; 37 -5, -3, -2, -1, -0.5, 0 };
241 r.translate(QPoint(x, y)); 241 r.translate(QPoint(x, y));
242 // cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << endl; 242 // cerr << "drawVisibleText: r = " << r.x() << "," <<r.y() << " " << r.width() << "x" << r.height() << endl;
243 paint.drawRect(r); 243 paint.drawRect(r);
244 paint.setBrush(Qt::NoBrush); 244 paint.setBrush(Qt::NoBrush);
245 245
246 paint.setPen(surroundColour); 246 paint.setPen(surroundColour);
247 247
248 for (int dx = -1; dx <= 1; ++dx) { 248 for (int dx = -1; dx <= 1; ++dx) {
249 for (int dy = -1; dy <= 1; ++dy) { 249 for (int dy = -1; dy <= 1; ++dy) {
250 if (!(dx || dy)) continue; 250 if (!(dx || dy)) continue;
251 paint.drawText(x + dx, y + dy, text); 251 paint.drawText(x + dx, y + dy, text);
252 } 252 }
253 } 253 }
254 254
255 paint.setPen(penColour); 255 paint.setPen(penColour);
256 256
257 paint.drawText(x, y, text); 257 paint.drawText(x, y, text);
258 258
259 paint.restore(); 259 paint.restore();
260 260
261 } else { 261 } else {
262 262