Path: blob/main/cad/freecad/files/patch-src_Mod_TechDraw_Gui_CommandCreateDims.cpp
56296 views
commit 9e5555fe3fd762474a531da72a3aa1a3cdb1b6c41Author: Chris <chris.r.jones.1983@gmail.com>2Date: Mon Apr 13 22:18:38 2026 -050034TechDraw: Remove explicit template use of std::abs (#28985)56Unnecessary, and fails to build on macOS 26.78diff --git src/Mod/TechDraw/Gui/CommandCreateDims.cpp src/Mod/TechDraw/Gui/CommandCreateDims.cpp9index cc3808bf7f..7e55d5993f 10064410--- src/Mod/TechDraw/Gui/CommandCreateDims.cpp11+++ src/Mod/TechDraw/Gui/CommandCreateDims.cpp12@@ -1127,7 +1127,7 @@ protected:13TechDraw::pointPair pp = dim->getLinearPoints();14float dx = pp.first().x - pp.second().x;15float dy = pp.first().y - pp.second().y;16- int alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));17+ int alpha = std::round(Base::toDegrees(std::abs(std::atan(type == "DistanceY" ? (dx / dy) : (dy / dx)))));18std::string sAlpha = std::to_string(alpha);19std::string formatSpec = dim->FormatSpec.getStrValue();20formatSpec = formatSpec + " x" + sAlpha + "°";21diff --git src/Mod/TechDraw/Gui/CommandExtensionDims.cpp src/Mod/TechDraw/Gui/CommandExtensionDims.cpp22index e7531ce714..46e6b4be4b 10064423--- src/Mod/TechDraw/Gui/CommandExtensionDims.cpp24+++ src/Mod/TechDraw/Gui/CommandExtensionDims.cpp25@@ -1984,7 +1984,7 @@ void execCreateHorizChamferDimension(Gui::Command* cmd) {26dim->Y.setValue(-yMax);27float dx = allVertexes[0].point.x - allVertexes[1].point.x;28float dy = allVertexes[0].point.y - allVertexes[1].point.y;29- float alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(dy / dx))));30+ float alpha = std::round(Base::toDegrees(std::abs(std::atan(dy / dx))));31std::string sAlpha = std::to_string((int)alpha);32std::string formatSpec = dim->FormatSpec.getStrValue();33formatSpec = formatSpec + " x" + sAlpha + "°";34@@ -2050,7 +2050,7 @@ void execCreateVertChamferDimension(Gui::Command* cmd) {35dim->Y.setValue(-mid.y);36float dx = allVertexes[0].point.x - allVertexes[1].point.x;37float dy = allVertexes[0].point.y - allVertexes[1].point.y;38- float alpha = std::round(Base::toDegrees(std::abs<float>(std::atan(dx / dy))));39+ float alpha = std::round(Base::toDegrees(std::abs(std::atan(dx / dy))));40std::string sAlpha = std::to_string((int)alpha);41std::string formatSpec = dim->FormatSpec.getStrValue();42formatSpec = formatSpec + " x" + sAlpha + "°";434445