From 1e9704dca9a861ffb7b2d3978e1390bea7af7ef0 Mon Sep 17 00:00:00 2001 From: neoraider Date: Wed, 26 Sep 2007 19:28:04 +0000 Subject: zoomedit: ?berschlagene Polygone werden jetzt korrekt gerendert --- Rectangle.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Rectangle.h') 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; -- cgit v1.2.3