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:
Benjamin Nauck
2025-04-17 00:19:26 +02:00
committed by GitHub
parent b5661da3a6
commit 66a664ae55
2 changed files with 3 additions and 2 deletions

View File

@@ -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 + "°";