aboutsummaryrefslogtreecommitdiff
path: root/src/Types.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Types.cpp')
-rw-r--r--src/Types.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Types.cpp b/src/Types.cpp
index 76bf398..accc99c 100644
--- a/src/Types.cpp
+++ b/src/Types.cpp
@@ -3,10 +3,10 @@
namespace cgeditor {
bool Element::IsOver(const double &X, const double &Y) const {
- if (width < 0) {
- return (x >= x && Y >= y && Y <= (y + height));
- }
- return ((X >= x && X <= (x + width) && Y >= y && Y <= (y + height)));
+ // Check if no overlap
+ if(X<x|| X>(x+width) || Y<y || Y>(y+height))
+ return false;
+ return true;
}
Property operator|(Property lhs, Property rhs) {