TechDraw: Fix MultiValueSchema formatting
Multi Value schemas cannot be forced to use Format::FORMATTED.
This commit is contained in:
@@ -77,7 +77,7 @@ std::string DimensionFormatter::formatValue(const qreal value,
|
||||
// won't give more than Global_Decimals precision
|
||||
std::string basicString = formatPrefix + asQuantity.getUserString() + formatSuffix;
|
||||
|
||||
if (isMultiValueSchema() && partial == Format::UNALTERED) {
|
||||
if (isMultiValueSchema() || partial == Format::UNALTERED) {
|
||||
return basicString; // Don't even try to use Alt Decimals or hide units
|
||||
}
|
||||
|
||||
|
||||
@@ -273,22 +273,15 @@ void QGIViewDimension::updateDim()
|
||||
return;
|
||||
}
|
||||
|
||||
QString labelText =
|
||||
// what about fromStdString?
|
||||
QString::fromUtf8(dim->getFormattedDimensionValue(Format::FORMATTED).c_str());// pre value [unit] post
|
||||
if (dim->isMultiValueSchema()) {
|
||||
labelText =
|
||||
QString::fromUtf8(dim->getFormattedDimensionValue(Format::UNALTERED).c_str());//don't format multis
|
||||
}
|
||||
|
||||
QFont font = datumLabel->getFont();
|
||||
auto labelText = dim->getFormattedDimensionValue(Format::FORMATTED);
|
||||
auto font = datumLabel->getFont();
|
||||
font.setFamily(QString::fromUtf8(vp->Font.getValue()));
|
||||
int fontSize = QGIView::exactFontSize(vp->Font.getValue(), std::max(1.0, vp->Fontsize.getValue()));
|
||||
font.setPixelSize(fontSize);
|
||||
datumLabel->setFont(font);
|
||||
|
||||
prepareGeometryChange();
|
||||
datumLabel->setDimString(labelText);
|
||||
datumLabel->setDimString(QString::fromStdString(labelText));
|
||||
datumLabel->setToleranceString();
|
||||
|
||||
datumLabel->setFramed(dim->TheoreticalExact.getValue());
|
||||
|
||||
Reference in New Issue
Block a user