Skip to content

Commit

Permalink
Fix negative value for position_smoothing_speed being allowed.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajreckof committed Apr 4, 2024
1 parent 29b3d9e commit 07406af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/2d/camera_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand Down

0 comments on commit 07406af

Please sign in to comment.