Techdraw: Use std::numeric_limits and std::numbers instead of defines

This commit is contained in:
Benjamin Nauck
2025-03-27 19:02:45 +01:00
parent 41756a3726
commit cf94011294
40 changed files with 243 additions and 220 deletions

View File

@@ -142,7 +142,7 @@ void DrawProjGroup::onChanged(const App::Property* prop)
if (prop == &ScaleType) {
if (ScaleType.isValue("Page")) {
double newScale = page->Scale.getValue();
if (std::abs(getScale() - newScale) > FLT_EPSILON) {
if (std::abs(getScale() - newScale) > std::numeric_limits<float>::epsilon()) {
Scale.setValue(newScale);
updateChildrenScale();
}
@@ -1146,9 +1146,9 @@ void DrawProjGroup::spin(const SpinDirection& spindirection)
{
double angle;
if (spindirection == SpinDirection::CW)
angle = M_PI / 2.0;// Top -> Right -> Bottom -> Left -> Top
angle = std::numbers::pi / 2.0;// Top -> Right -> Bottom -> Left -> Top
if (spindirection == SpinDirection::CCW)
angle = -M_PI / 2.0;// Top -> Left -> Bottom -> Right -> Top
angle = -std::numbers::pi / 2.0;// Top -> Left -> Bottom -> Right -> Top
spin(angle);
}