mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 10:45:58 +01:00
Fix possible usage of clamp with lo > hi in Vector2D (#2049)
This commit is contained in:
parent
afc887d941
commit
c86f06caa0
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ Vector2D Vector2D::floor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) {
|
Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) {
|
||||||
return Vector2D(std::clamp(this->x, min.x, max.x == 0 ? INFINITY : max.x), std::clamp(this->y, min.y, max.y == 0 ? INFINITY : max.y));
|
return Vector2D(std::clamp(this->x, min.x, max.x < min.x ? INFINITY : max.x), std::clamp(this->y, min.y, max.y < min.y ? INFINITY : max.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
double Vector2D::distance(const Vector2D& other) {
|
double Vector2D::distance(const Vector2D& other) {
|
||||||
|
|
Loading…
Reference in a new issue