Techdraw: Use std::numeric_limits and std::numbers instead of defines
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user