Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Shute052 committed Mar 1, 2024
1 parent a3ccf29 commit f8a3d4d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/input_settings/deadzones.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ impl Deadzone2 {

/// Creates a new [`Deadzone2::Circle`] instance with the given settings.
///
/// If both `radius_x` and `radius_y` are non-positive, returns the constant [`Deadzone2::None`].
/// If both `radius_x` and `radius_y` are non-positive, returns [`Deadzone2::None`].
///
/// # Arguments
///
Expand Down Expand Up @@ -274,6 +274,9 @@ impl Deadzone2 {
/// If both `threshold_x` and `threshold_y` are non-positive,
/// a [`Deadzone2::Circle`] with the specified radii will be created instead.
///
/// If both `radius_x` and `radius_y` are non-positive,
/// a [`Deadzone2::Square`] with the specified radii will be created instead.
///
/// # Arguments
///
/// - `threshold_x`: Threshold for the absolute value of input values along the x-axis,
Expand All @@ -293,6 +296,10 @@ impl Deadzone2 {
return Self::circle(radius_x, radius_y);
}

if radius_x <= 0.0 && radius_y <= 0.0 {
return Self::square(threshold_x, threshold_y);
}

Self::RoundedSquare {
// Ensure all the components are within the range `[0.0, MAX]`
threshold_x: threshold_x.clamp(0.0, DEFAULT_LIVEZONE_UPPER),
Expand Down

0 comments on commit f8a3d4d

Please sign in to comment.