summaryrefslogtreecommitdiff
path: root/src/helpers/Vector2D.cpp
diff options
context:
space:
mode:
authorrszyma <rszyma.dev@gmail.com>2024-01-26 23:30:36 +0100
committerGitHub <noreply@github.com>2024-01-26 22:30:36 +0000
commit12d79d63421e2ed3f31130755c7a37f0e4fb5cb1 (patch)
treec28e1e61816908f96a0030842402c88212960f5b /src/helpers/Vector2D.cpp
parent08e35197478d4abbd009333301e77f7da2ff53a3 (diff)
dwindle: fix windows being created at incorrect position when cursor is over reserved area (#4520)
* fix: smart_split not working correctly when creating a window with cursor over reserved area * use getClosestNodeOnWorkspace instead of getFirstNodeOnWorkspace when hovering over reserved area * optimize `getClosestNodeOnWorkspace` * remove unused methods
Diffstat (limited to 'src/helpers/Vector2D.cpp')
-rw-r--r--src/helpers/Vector2D.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/helpers/Vector2D.cpp b/src/helpers/Vector2D.cpp
index 7bc6412d..fb432936 100644
--- a/src/helpers/Vector2D.cpp
+++ b/src/helpers/Vector2D.cpp
@@ -42,14 +42,6 @@ double Vector2D::distance(const Vector2D& other) const {
return std::sqrt(dx * dx + dy * dy);
}
-bool Vector2D::inTriangle(const Vector2D& p1, const Vector2D& p2, const Vector2D& p3) const {
- const auto a = ((p2.y - p3.y) * (x - p3.x) + (p3.x - p2.x) * (y - p3.y)) / ((p2.y - p3.y) * (p1.x - p3.x) + (p3.x - p2.x) * (p1.y - p3.y));
- const auto b = ((p3.y - p1.y) * (x - p3.x) + (p1.x - p3.x) * (y - p3.y)) / ((p2.y - p3.y) * (p1.x - p3.x) + (p3.x - p2.x) * (p1.y - p3.y));
- const auto c = 1 - a - b;
-
- return 0 <= a && a <= 1 && 0 <= b && b <= 1 && 0 <= c && c <= 1;
-}
-
double Vector2D::size() const {
return std::sqrt(x * x + y * y);
}