Mercurial > hg > svgui
comparison layer/TimeValueLayer.cpp @ 1537:4f8c72adbf43
Clarify naming of some view-related methods. Rename LayerGeometryProvider::getValueExtents to getVisibleExtentsForUnit, and View::getTextLabelHeight to getTextLabelYCoord. Add View::getVisibleExtentsForAnyUnit to be used to determine which unit to adopt in a new e.g. box layer.
author | Chris Cannam |
---|---|
date | Tue, 15 Oct 2019 11:40:56 +0100 |
parents | 37df1530519d |
children | 9ce6f69cd485 |
comparison
equal
deleted
inserted
replaced
1536:5a215033b853 | 1537:4f8c72adbf43 |
---|---|
779 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); | 779 auto model = ModelById::getAs<SparseTimeValueModel>(m_model); |
780 if (!model) return; | 780 if (!model) return; |
781 | 781 |
782 if (shouldAutoAlign()) { | 782 if (shouldAutoAlign()) { |
783 | 783 |
784 if (!v->getValueExtents(getScaleUnits(), min, max, log)) { | 784 if (!v->getVisibleExtentsForUnit(getScaleUnits(), min, max, log)) { |
785 min = model->getValueMinimum(); | 785 min = model->getValueMinimum(); |
786 max = model->getValueMaximum(); | 786 max = model->getValueMaximum(); |
787 } else if (log) { | 787 } else if (log) { |
788 LogRange::mapRange(min, max); | 788 LogRange::mapRange(min, max); |
789 } | 789 } |
966 QPainterPath path; | 966 QPainterPath path; |
967 int pointCount = 0; | 967 int pointCount = 0; |
968 | 968 |
969 int textY = 0; | 969 int textY = 0; |
970 if (m_plotStyle == PlotSegmentation) { | 970 if (m_plotStyle == PlotSegmentation) { |
971 textY = v->getTextLabelHeight(this, paint); | 971 textY = v->getTextLabelYCoord(this, paint); |
972 } else { | 972 } else { |
973 int originY = getYForValue(v, 0.f); | 973 int originY = getYForValue(v, 0.f); |
974 if (originY > 0 && originY < v->getPaintHeight()) { | 974 if (originY > 0 && originY < v->getPaintHeight()) { |
975 paint.save(); | 975 paint.save(); |
976 paint.setPen(getPartialShades(v)[1]); | 976 paint.setPen(getPartialShades(v)[1]); |