X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmath%2Frect.hpp;h=2c30258b7515c5b5a48e00ae38dd387f1ed84bfb;hb=1dbdd25460227fc9e6f8942dadad741f67151540;hp=2a50dd955dac977d3d199379ca16c188fe9d868d;hpb=6e7c8fafae2311b22c78b1ea597a408396873560;p=supertux.git diff --git a/src/math/rect.hpp b/src/math/rect.hpp index 2a50dd955..2c30258b7 100644 --- a/src/math/rect.hpp +++ b/src/math/rect.hpp @@ -83,7 +83,7 @@ public: { set_width(width); set_height(height); - } + } Vector get_size() { return Vector(get_width(), get_height()); @@ -95,11 +95,11 @@ public: p2 += v; } - bool inside(const Vector& v) const + bool contains(const Vector& v) const { return v.x >= p1.x && v.y >= p1.y && v.x < p2.x && v.y < p2.y; } - bool inside(const Rect& other) const + bool contains(const Rect& other) const { if(p1.x >= other.p2.x || other.p1.x >= p2.x) return false; @@ -108,7 +108,7 @@ public: return true; } - + // leave these 2 public to safe the headaches of set/get functions for such // simple things :) @@ -119,4 +119,3 @@ public: }; #endif -