TechDraw: Potential fix for snap builds, specify type.. again (#20831)
* TechDraw: Potential fix for snap builds, specify type * Techdraw: Fix more toDegrees-issues
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -1140,7 +1141,7 @@ protected:
|
||||
TechDraw::pointPair pp = dim->getLinearPoints();
|
||||
float dx = pp.first().x - pp.second().x;
|
||||
float dy = pp.first().y - pp.second().y;
|
||||
int alpha = round(Base::toDegrees(abs(atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));
|
||||
int alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));
|
||||
std::string sAlpha = std::to_string(alpha);
|
||||
std::string formatSpec = dim->FormatSpec.getStrValue();
|
||||
formatSpec = formatSpec + " x" + sAlpha + "°";
|
||||
|
||||
@@ -2063,7 +2063,7 @@ void execCreateHorizChamferDimension(Gui::Command* cmd) {
|
||||
dim->Y.setValue(-yMax);
|
||||
float dx = allVertexes[0].point.x - allVertexes[1].point.x;
|
||||
float dy = allVertexes[0].point.y - allVertexes[1].point.y;
|
||||
float alpha = round(Base::toDegrees(abs(atan(dy / dx))));
|
||||
float alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(dy / dx))));
|
||||
std::string sAlpha = std::to_string((int)alpha);
|
||||
std::string formatSpec = dim->FormatSpec.getStrValue();
|
||||
formatSpec = formatSpec + " x" + sAlpha + "°";
|
||||
|
||||
Reference in New Issue
Block a user