summaryrefslogtreecommitdiffstats
path: root/Rectangle.h
diff options
context:
space:
mode:
Diffstat (limited to 'Rectangle.h')
-rw-r--r--Rectangle.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/Rectangle.h b/Rectangle.h
index 5e7bb94..01b553c 100644
--- a/Rectangle.h
+++ b/Rectangle.h
@@ -19,7 +19,7 @@ class Rectangle {
public:
Rectangle() {}
Rectangle(const Vertex& vertex1, const Vertex& vertex2) : v1(vertex1), v2(vertex2) {}
- Rectangle(double x, double y, double width, double height)
+ Rectangle(float x, float y, float width, float height)
: v1(x, y), v2(x+width, y+height) {}
Vertex &getVertex1() {return v1;}
@@ -30,13 +30,13 @@ class Rectangle {
const Vertex &getVertex2() const {return v2;}
void setVertex2(const Vertex &v) {v2 = v;}
- double getWidth() const {return v2.getX()-v1.getX();}
- void setWidth(double width) {v2.setX(v1.getX()+width);}
+ float getWidth() const {return v2.getX()-v1.getX();}
+ void setWidth(float width) {v2.setX(v1.getX()+width);}
- double getHeight() const {return v2.getY()-v1.getY();}
- void setHeight(double height) {v2.setY(v1.getY()+height);}
+ float getHeight() const {return v2.getY()-v1.getY();}
+ void setHeight(float height) {v2.setY(v1.getY()+height);}
- double area() const {return getWidth()*getHeight();}
+ float area() const {return getWidth()*getHeight();}
bool contains(const Vertex &v) const;