Merge pull request #90167 from ajreckof/fix-negative-value-for-position_smoothing_speed-being-allowed

Ensure `Camera2D.position_smoothing_speed` is non-negative.
This commit is contained in:
Rémi Verschelde 2024-04-05 12:16:14 +02:00
commit fe784573c4
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -627,7 +627,7 @@ void Camera2D::align() {
}
void Camera2D::set_position_smoothing_speed(real_t p_speed) {
position_smoothing_speed = p_speed;
position_smoothing_speed = MAX(0, p_speed);
_update_process_internal_for_smoothing();
}
@ -636,7 +636,7 @@ real_t Camera2D::get_position_smoothing_speed() const {
}
void Camera2D::set_rotation_smoothing_speed(real_t p_speed) {
rotation_smoothing_speed = p_speed;
rotation_smoothing_speed = MAX(0, p_speed);
_update_process_internal_for_smoothing();
}