Skip to content

Commit

Permalink
Merge pull request #90167 from ajreckof/fix-negative-value-for-positi…
Browse files Browse the repository at this point in the history
…on_smoothing_speed-being-allowed

Ensure `Camera2D.position_smoothing_speed` is non-negative.
  • Loading branch information
akien-mga committed Apr 5, 2024
2 parents f2cc814 + 07406af commit fe78457
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 fe78457

Please sign in to comment.