From cbd9eb18c6ce2824087c8046034e700e883ea57d Mon Sep 17 00:00:00 2001 From: wandererfan Date: Sun, 1 Jul 2018 12:54:52 -0400 Subject: [PATCH] Fix initial placement of linear dims --- src/Mod/TechDraw/Gui/CommandCreateDims.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp index 61ddd139ad..6708c8f23f 100644 --- a/src/Mod/TechDraw/Gui/CommandCreateDims.cpp +++ b/src/Mod/TechDraw/Gui/CommandCreateDims.cpp @@ -500,8 +500,12 @@ void CmdTechDrawNewLengthDimension::activated(int iMsg) commitCommand(); dim->recomputeFeature(); + TechDraw::pointPair pp = dim->getLinearPoints(); + Base::Vector3d mid = (pp.first + pp.second)/2.0; + dim->X.setValue(mid.x); + dim->Y.setValue(-mid.y); - //Horrible hack to force Tree update + //Horrible hack to force Tree update (claimChildren) double x = objFeat->X.getValue(); objFeat->X.setValue(x); } @@ -609,6 +613,10 @@ void CmdTechDrawNewDistanceXDimension::activated(int iMsg) commitCommand(); dim->recomputeFeature(); + TechDraw::pointPair pp = dim->getLinearPoints(); + Base::Vector3d mid = (pp.first + pp.second)/2.0; + dim->X.setValue(mid.x); + dim->Y.setValue(-mid.y); //Horrible hack to force Tree update double x = objFeat->X.getValue(); @@ -717,6 +725,10 @@ void CmdTechDrawNewDistanceYDimension::activated(int iMsg) commitCommand(); dim->recomputeFeature(); + TechDraw::pointPair pp = dim->getLinearPoints(); + Base::Vector3d mid = (pp.first + pp.second)/2.0; + dim->X.setValue(mid.x); + dim->Y.setValue(-mid.y); //Horrible hack to force Tree update double x = objFeat->X.getValue();