Skip to content

Commit

Permalink
[TD]Fix duplicate Arbitrary dim text
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Oct 18, 2019
1 parent 5512d54 commit a1de871
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Mod/TechDraw/Gui/QGIViewDimension.cpp
Expand Up @@ -538,21 +538,26 @@ void QGIViewDimension::updateDim()
if ( vp == nullptr ) {
return;
}

// QString labelText = QString::fromUtf8(dim->getFormatedValue().c_str());
//want this split into value and unit
QString labelText = QString::fromUtf8(dim->getFormatedValue(1).c_str()); //just the number
QString unitText = QString::fromUtf8(dim->getFormatedValue(2).c_str()); //just the unit

QString arbText = QString::fromUtf8(dim->FormatSpec.getValue());

QFont font = datumLabel->getFont();
font.setFamily(QString::fromUtf8(vp->Font.getValue()));
font.setPixelSize(calculateFontPixelSize(vp->Fontsize.getValue()));
datumLabel->setFont(font);

prepareGeometryChange();
datumLabel->setDimString(labelText);
datumLabel->setTolString();
datumLabel->setUnitString(unitText);
if (dim->Arbitrary.getValue()) {
datumLabel->setDimString(arbText);
} else {
datumLabel->setDimString(labelText);
datumLabel->setTolString();
datumLabel->setUnitString(unitText);
}
datumLabel->setPosFromCenter(datumLabel->X(),datumLabel->Y());

datumLabel->setFramed(dim->TheoreticalExact.getValue());
Expand Down

0 comments on commit a1de871

Please sign in to comment.