Mercurial > hg > svgui
comparison layer/Colour3DPlotLayer.cpp @ 1078:ee01a4062747 spectrogram-minor-refactor
Move drawVisibleText to PaintAssistant
author | Chris Cannam |
---|---|
date | Thu, 30 Jun 2016 12:40:22 +0100 |
parents | 5144d7185fb5 |
children | 179ea8a2f650 |
comparison
equal
deleted
inserted
replaced
1077:5144d7185fb5 | 1078:ee01a4062747 |
---|---|
19 #include "base/LogRange.h" | 19 #include "base/LogRange.h" |
20 #include "base/RangeMapper.h" | 20 #include "base/RangeMapper.h" |
21 | 21 |
22 #include "ColourMapper.h" | 22 #include "ColourMapper.h" |
23 #include "LayerGeometryProvider.h" | 23 #include "LayerGeometryProvider.h" |
24 #include "PaintAssistant.h" | |
24 | 25 |
25 #include "view/ViewManager.h" | 26 #include "view/ViewManager.h" |
26 | 27 |
27 #include <QPainter> | 28 #include <QPainter> |
28 #include <QImage> | 29 #include <QImage> |
865 m.translate(cw - 6, ch + 10); | 866 m.translate(cw - 6, ch + 10); |
866 m.rotate(-90); | 867 m.rotate(-90); |
867 | 868 |
868 paint.setWorldMatrix(m); | 869 paint.setWorldMatrix(m); |
869 | 870 |
870 v->drawVisibleText(paint, 2, 0, minstr, LayerGeometryProvider::OutlinedText); | 871 PaintAssistant::drawVisibleText(v, paint, 2, 0, minstr, PaintAssistant::OutlinedText); |
871 | 872 |
872 m.translate(ch - msw - 2, 0); | 873 m.translate(ch - msw - 2, 0); |
873 paint.setWorldMatrix(m); | 874 paint.setWorldMatrix(m); |
874 | 875 |
875 v->drawVisibleText(paint, 0, 0, maxstr, LayerGeometryProvider::OutlinedText); | 876 PaintAssistant::drawVisibleText(v, paint, 0, 0, maxstr, PaintAssistant::OutlinedText); |
876 | 877 |
877 paint.restore(); | 878 paint.restore(); |
878 } | 879 } |
879 | 880 |
880 paint.setPen(v->getForeground()); | 881 paint.setPen(v->getForeground()); |
1438 if (sx >= 0 && sx < m_cache->width() && | 1439 if (sx >= 0 && sx < m_cache->width() && |
1439 sy >= 0 && sy < m_cache->height()) { | 1440 sy >= 0 && sy < m_cache->height()) { |
1440 double value = m_model->getValueAt(sx, sy); | 1441 double value = m_model->getValueAt(sx, sy); |
1441 snprintf(labelbuf, buflen, "%06f", value); | 1442 snprintf(labelbuf, buflen, "%06f", value); |
1442 QString text(labelbuf); | 1443 QString text(labelbuf); |
1443 v->drawVisibleText | 1444 PaintAssistant::drawVisibleText |
1444 (paint, | 1445 (v, |
1446 paint, | |
1445 rx0 + 2, | 1447 rx0 + 2, |
1446 ry0 - h / sh - 1 + 2 + paint.fontMetrics().ascent(), | 1448 ry0 - h / sh - 1 + 2 + paint.fontMetrics().ascent(), |
1447 text, | 1449 text, |
1448 LayerGeometryProvider::OutlinedText); | 1450 PaintAssistant::OutlinedText); |
1449 } | 1451 } |
1450 } | 1452 } |
1451 } | 1453 } |
1452 } | 1454 } |
1453 } | 1455 } |