diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/texture_progress_bar.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scene/gui/texture_progress_bar.cpp b/scene/gui/texture_progress_bar.cpp index 4ad56d21d3..24c68e0188 100644 --- a/scene/gui/texture_progress_bar.cpp +++ b/scene/gui/texture_progress_bar.cpp @@ -608,11 +608,10 @@ int TextureProgressBar::get_fill_mode() { } void TextureProgressBar::set_radial_initial_angle(float p_angle) { - while (p_angle > 360) { - p_angle -= 360; - } - while (p_angle < 0) { - p_angle += 360; + ERR_FAIL_COND_MSG(!Math::is_finite(p_angle), "Angle is non-finite."); + + if (p_angle < 0.0 || p_angle > 360.0) { + p_angle = Math::fposmodp(p_angle, 360.0f); } if (rad_init_angle == p_angle) { |