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:
commit
fe784573c4
|
@ -627,7 +627,7 @@ void Camera2D::align() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera2D::set_position_smoothing_speed(real_t p_speed) {
|
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();
|
_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) {
|
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();
|
_update_process_internal_for_smoothing();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue