Fix negative value for position_smoothing_speed being allowed.

This commit is contained in:
ajreckof 2024-04-03 12:35:18 +02:00
parent 29b3d9e9e5
commit 07406af6cc
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();
}