Mercurial > hg > svgui
comparison layer/RegionLayer.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 | e6362cf5ff1d |
comparison
equal
deleted
inserted
replaced
1536:5a215033b853 | 1537:4f8c72adbf43 |
---|---|
606 QString queryUnits; | 606 QString queryUnits; |
607 queryUnits = getScaleUnits(); | 607 queryUnits = getScaleUnits(); |
608 | 608 |
609 if (m_verticalScale == AutoAlignScale) { | 609 if (m_verticalScale == AutoAlignScale) { |
610 | 610 |
611 if (!v->getValueExtents(queryUnits, min, max, log)) { | 611 if (!v->getVisibleExtentsForUnit(queryUnits, min, max, log)) { |
612 | 612 |
613 min = model->getValueMinimum(); | 613 min = model->getValueMinimum(); |
614 max = model->getValueMaximum(); | 614 max = model->getValueMaximum(); |
615 | 615 |
616 // cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl; | 616 // cerr << "RegionLayer[" << this << "]::getScaleExtents: min = " << min << ", max = " << max << ", log = " << log << endl; |
1025 labelX = x - labelWidth - gap; | 1025 labelX = x - labelWidth - gap; |
1026 labelY = y + paint.fontMetrics().height()/2 | 1026 labelY = y + paint.fontMetrics().height()/2 |
1027 - paint.fontMetrics().descent(); | 1027 - paint.fontMetrics().descent(); |
1028 } else { | 1028 } else { |
1029 labelX = x + 5; | 1029 labelX = x + 5; |
1030 labelY = v->getTextLabelHeight(this, paint); | 1030 labelY = v->getTextLabelYCoord(this, paint); |
1031 if (labelX < nextLabelMinX) { | 1031 if (labelX < nextLabelMinX) { |
1032 if (lastLabelY < v->getPaintHeight()/2) { | 1032 if (lastLabelY < v->getPaintHeight()/2) { |
1033 labelY = lastLabelY + fontHeight; | 1033 labelY = lastLabelY + fontHeight; |
1034 } | 1034 } |
1035 } | 1035 } |