Skip to content

Commit

Permalink
[TD]Adjust initial placement of dim text
Browse files Browse the repository at this point in the history
  • Loading branch information
WandererFan committed Jan 21, 2022
1 parent 253817e commit cf5a14b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Mod/TechDraw/Gui/CommandCreateDims.cpp
Expand Up @@ -58,10 +58,10 @@
# include <Mod/TechDraw/App/DrawPage.h>
# include <Mod/TechDraw/App/DrawUtil.h>
# include <Mod/TechDraw/App/Geometry.h>
# include <Mod/TechDraw/App/Preferences.h>

#include <Mod/TechDraw/Gui/QGVPage.h>


#include "DrawGuiUtil.h"
#include "MDIViewPage.h"
#include "ViewProviderPage.h"
Expand Down Expand Up @@ -563,10 +563,12 @@ void CmdTechDrawLengthDimension::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);
double fontSize = Preferences::dimFontSizeMM();
dim->Y.setValue(-mid.y + 0.5 * fontSize);

//Horrible hack to force Tree update (claimChildren)
double x = objFeat->X.getValue();
Expand Down Expand Up @@ -668,7 +670,8 @@ void CmdTechDrawHorizontalDimension::activated(int iMsg)
TechDraw::pointPair pp = dim->getLinearPoints();
Base::Vector3d mid = (pp.first + pp.second)/2.0;
dim->X.setValue(mid.x);
dim->Y.setValue(-mid.y);
double fontSize = Preferences::dimFontSizeMM();
dim->Y.setValue(-mid.y + 0.5 * fontSize);

//Horrible hack to force Tree update
double x = objFeat->X.getValue();
Expand Down Expand Up @@ -769,7 +772,8 @@ void CmdTechDrawVerticalDimension::activated(int iMsg)
TechDraw::pointPair pp = dim->getLinearPoints();
Base::Vector3d mid = (pp.first + pp.second)/2.0;
dim->X.setValue(mid.x);
dim->Y.setValue(-mid.y);
double fontSize = Preferences::dimFontSizeMM();
dim->Y.setValue(-mid.y + 0.5 * fontSize);

//Horrible hack to force Tree update
double x = objFeat->X.getValue();
Expand Down

0 comments on commit cf5a14b

Please sign in to comment.