Part: use UnitsApi::getDecimals in ShapeFromMesh dialog

This commit is contained in:
wmayer
2021-10-05 12:42:48 +02:00
parent f355b8556c
commit d569c8aa25

View File

@@ -28,7 +28,7 @@
#include "ShapeFromMesh.h"
#include "ui_ShapeFromMesh.h"
#include <App/Application.h>
#include <Base/UnitsApi.h>
#include <App/DocumentObserver.h>
#include <Gui/CommandT.h>
#include <Gui/Selection.h>
@@ -46,8 +46,7 @@ ShapeFromMesh::ShapeFromMesh(QWidget* parent, Qt::WindowFlags fl)
double STD_OCC_TOLERANCE = 1e-6;
ParameterGrp::handle hGrp = App::GetApplication().GetParameterGroupByPath("User parameter:BaseApp/Preferences/Units");
int decimals = hGrp->GetInt("Decimals");
int decimals = Base::UnitsApi::getDecimals();
double tolerance_from_decimals = pow(10., -decimals);
double minimal_tolerance = tolerance_from_decimals < STD_OCC_TOLERANCE ? STD_OCC_TOLERANCE : tolerance_from_decimals;