diff options
author | neoraider <devnull@localhost> | 2007-09-26 21:28:04 +0200 |
---|---|---|
committer | neoraider <devnull@localhost> | 2007-09-26 21:28:04 +0200 |
commit | 1e9704dca9a861ffb7b2d3978e1390bea7af7ef0 (patch) | |
tree | 5c6b7cc9486cb48129549f65b969f490fbf01d7a /Rectangle.h | |
parent | 62e42408485e9e1b7e939925b650a4b2e90ecddb (diff) | |
download | zoomedit-1e9704dca9a861ffb7b2d3978e1390bea7af7ef0.tar zoomedit-1e9704dca9a861ffb7b2d3978e1390bea7af7ef0.zip |
zoomedit: ?berschlagene Polygone werden jetzt korrekt gerendert
Diffstat (limited to 'Rectangle.h')
-rw-r--r-- | Rectangle.h | 12 |
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; |