Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Vector::unit_v #1085

Merged
merged 2 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/fj-math/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ impl Scalar {
}

/// Compute the maximum of this and another scalar
pub fn max(self, other: Self) -> Self {
self.0.max(other.0).into()
pub fn max(self, other: impl Into<Self>) -> Self {
self.0.max(other.into().0).into()
}

/// Compute the smallest integer larger than or equal to this scalar
Expand Down
2 changes: 1 addition & 1 deletion crates/fj-math/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ impl Vector<2> {

/// Construct a `Vector` that represents the v-axis
pub fn unit_v() -> Self {
Vector::from([1., 0.])
Vector::from([0., 1.])
}

/// Compute the 2D cross product with another vector
Expand Down