diff options
| author | vaxerski <vaxry@vaxry.net> | 2023-06-23 21:14:04 +0200 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2023-06-23 21:42:44 +0200 |
| commit | 01f85a09a981eb6c8784d459f729d418c0dd19e3 (patch) | |
| tree | 7539008648c010ec5e188f5104ebc94e4ccb0690 /src/helpers/Vector2D.cpp | |
| parent | 69fae18e636ed154798c21ed5c1127672127c6ac (diff) | |
xwayland: send zero scaling to xwayland if enabled
Diffstat (limited to 'src/helpers/Vector2D.cpp')
| -rw-r--r-- | src/helpers/Vector2D.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp index 2d52eb9e..21701c97 100644 --- a/src/helpers/Vector2D.cpp +++ b/src/helpers/Vector2D.cpp @@ -24,15 +24,15 @@ double Vector2D::normalize() { return max; } -Vector2D Vector2D::floor() { +Vector2D Vector2D::floor() const { return Vector2D(std::floor(x), std::floor(y)); } -Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) { +Vector2D Vector2D::clamp(const Vector2D& min, const Vector2D& max) const { 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) const { double dx = x - other.x; double dy = y - other.y; return std::sqrt(dx * dx + dy * dy); |
