Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports
Path: blob/main/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp
56296 views
1
commit 9e5555fe3fd762474a531da72a3aa1a3cdb1b6c4
2
Author: Chris <chris.r.jones.1983@gmail.com>
3
Date: Mon Apr 13 22:18:38 2026 -0500
4
5
TechDraw: Remove explicit template use of std::abs (#28985)
6
7
Unnecessary, and fails to build on macOS 26.
8
9
diff --git src/Mod/TechDraw/Gui/CommandCreateDims.cpp src/Mod/TechDraw/Gui/CommandCreateDims.cpp
10
index cc3808bf7f..7e55d5993f 100644
11
--- src/Mod/TechDraw/Gui/CommandCreateDims.cpp
12
+++ src/Mod/TechDraw/Gui/CommandCreateDims.cpp
13
@@ -1127,7 +1127,7 @@ protected:
14
TechDraw::pointPair pp = dim->getLinearPoints();
15
float dx = pp.first().x - pp.second().x;
16
float dy = pp.first().y - pp.second().y;
17
- int alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));
18
+ int alpha = std::round(Base::toDegrees(std::abs(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));
19
std::string sAlpha = std::to_string(alpha);
20
std::string formatSpec = dim->FormatSpec.getStrValue();
21
formatSpec = formatSpec + " x" + sAlpha + "°";
22
diff --git src/Mod/TechDraw/Gui/CommandExtensionDims.cpp src/Mod/TechDraw/Gui/CommandExtensionDims.cpp
23
index e7531ce714..46e6b4be4b 100644
24
--- src/Mod/TechDraw/Gui/CommandExtensionDims.cpp
25
+++ src/Mod/TechDraw/Gui/CommandExtensionDims.cpp
26
@@ -1984,7 +1984,7 @@ void execCreateHorizChamferDimension(Gui::Command* cmd) {
27
dim->Y.setValue(-yMax);
28
float dx = allVertexes[0].point.x - allVertexes[1].point.x;
29
float dy = allVertexes[0].point.y - allVertexes[1].point.y;
30
- float alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(dy / dx))));
31
+ float alpha = std::round(Base::toDegrees(std::abs(std::atan(dy / dx))));
32
std::string sAlpha = std::to_string((int)alpha);
33
std::string formatSpec = dim->FormatSpec.getStrValue();
34
formatSpec = formatSpec + " x" + sAlpha + "°";
35
@@ -2050,7 +2050,7 @@ void execCreateVertChamferDimension(Gui::Command* cmd) {
36
dim->Y.setValue(-mid.y);
37
float dx = allVertexes[0].point.x - allVertexes[1].point.x;
38
float dy = allVertexes[0].point.y - allVertexes[1].point.y;
39
- float alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(dx / dy))));
40
+ float alpha = std::round(Base::toDegrees(std::abs(std::atan(dx / dy))));
41
std::string sAlpha = std::to_string((int)alpha);
42
std::string formatSpec = dim->FormatSpec.getStrValue();
43
formatSpec = formatSpec + " x" + sAlpha + "°";
44
45