summaryrefslogtreecommitdiff
path: root/engine/include
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-04-21 22:52:28 +0200
committerAki <please@ignore.pl>2024-04-05 19:41:19 +0200
commit654c94e1d312970413e376214b11bd554040d30f (patch)
tree217084920141425c3f7f5bbc4657a97523dde5c0 /engine/include
parent727ae858a73f4c36bf253a873530dc4dd78c498f (diff)
downloadkurator-654c94e1d312970413e376214b11bd554040d30f.zip
kurator-654c94e1d312970413e376214b11bd554040d30f.tar.gz
kurator-654c94e1d312970413e376214b11bd554040d30f.tar.bz2
Replaced Mouse dragging start+pos combo with a Rect
Diffstat (limited to 'engine/include')
-rw-r--r--engine/include/kurator/engine/Point.h1
-rw-r--r--engine/include/kurator/engine/Rect.h27
2 files changed, 28 insertions, 0 deletions
diff --git a/engine/include/kurator/engine/Point.h b/engine/include/kurator/engine/Point.h
index 4b352d6..eecf2c6 100644
--- a/engine/include/kurator/engine/Point.h
+++ b/engine/include/kurator/engine/Point.h
@@ -23,6 +23,7 @@ struct Point
Point subtract(double _x, double _y) const;
bool operator==(const Point& other) const;
bool operator!=(const Point& other) const;
+ friend Point abs(const Point& point);
};
diff --git a/engine/include/kurator/engine/Rect.h b/engine/include/kurator/engine/Rect.h
new file mode 100644
index 0000000..d485937
--- /dev/null
+++ b/engine/include/kurator/engine/Rect.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Point.h"
+
+
+namespace kurator
+{
+namespace engine
+{
+
+
+struct Rect
+{
+ Rect();
+ Rect(const Point& first, const Point& second);
+ Point position;
+ Point size;
+ Point topleft() const;
+ Point bottomright() const;
+ Point center() const;
+ bool contains(const Point& point);
+ bool contains(const Point& circle, double radius);
+};
+
+
+} // namespace engine
+} // namespace kurator