Skip to content

Commit

Permalink
[Sketch] remove now unused variable
Browse files Browse the repository at this point in the history
also add comment for better understanding
  • Loading branch information
donovaly authored and wwmayer committed Nov 8, 2020
1 parent c5a4b01 commit 9b5eb77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Mod/Sketcher/Gui/ViewProviderSketch.cpp
Expand Up @@ -4245,7 +4245,7 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer

// pole weights --------------------------------------------------------
std::vector<double> weights = spline->getWeights();
auto TextBegin = hGrpsk->GetBool("BSplineKnotMultiplicityVisible", true) ? " [" : "[";

if (rebuildinformationlayer) {

for (size_t index = 0; index < weights.size(); ++index) {
Expand Down Expand Up @@ -4278,6 +4278,9 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
QString WeightString = QString::fromLatin1("%1").arg(weights[index], 0, 'f', Base::UnitsApi::getDecimals());

SoText2* WeightText = new SoText2;
// since the first and last control point of a spline is also treated as knot and thus
// can also have a displayed multiplicity, we must assure the multiplicity is not visibly overwritten
// therefore be output the weight in a second line
SoMFString label;
label.set1Value(0, SbString(""));
label.set1Value(1, SbString("[") + SbString(WeightString.toStdString().c_str()) + SbString("]"));
Expand Down Expand Up @@ -4311,8 +4314,12 @@ void ViewProviderSketch::draw(bool temp /*=false*/, bool rebuildinformationlayer
static_cast<SoTranslation*>(sep->getChild(GEOINFO_BSPLINE_DEGREE_POS))
->translation.setValue(poleposition.x, poleposition.y, zInfo);

// set up string with weight value and the user-defined number of decimals
QString WeightString = QString::fromLatin1("%1").arg(weights[index], 0, 'f', Base::UnitsApi::getDecimals());

// since the first and last control point of a spline is also treated as knot and thus
// can also have a displayed multiplicity, we must assure the multiplicity is not visibly overwritten
// therefore be output the weight in a second line
SoMFString label;
label.set1Value(0, SbString(""));
label.set1Value(1, SbString("[") + SbString(WeightString.toStdString().c_str()) + SbString("]"));
Expand Down

0 comments on commit 9b5eb77

Please sign in to comment.