summaryrefslogtreecommitdiffstats
path: root/Vertex.cpp
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2008-02-08 22:21:01 +0100
committerneoraider <devnull@localhost>2008-02-08 22:21:01 +0100
commitacb1721e94a49a4941bb11dfc2f832c3848aa204 (patch)
tree6398053a11b46242974ae171d700418bd42c92b8 /Vertex.cpp
parenta39525ca36e2c002332f914907f74061533c2b04 (diff)
downloadzoomedit-acb1721e94a49a4941bb11dfc2f832c3848aa204.tar
zoomedit-acb1721e94a49a4941bb11dfc2f832c3848aa204.zip
zoomedit: Implemented Rotate tool; added simple gates.
Diffstat (limited to 'Vertex.cpp')
-rw-r--r--Vertex.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/Vertex.cpp b/Vertex.cpp
index 7e2528f..6e1f26b 100644
--- a/Vertex.cpp
+++ b/Vertex.cpp
@@ -18,6 +18,14 @@ Vertex Vertex::operator-(const Vertex &v) const {
return Vertex(x - v.x, y - v.y);
}
+Vertex Vertex::operator*(float f) const {
+ return Vertex(x*f, y*f);
+}
+
+Vertex Vertex::operator/(float f) const {
+ return Vertex(x/f, y/f);
+}
+
Vertex& Vertex::operator+=(const Vertex &v) {
x += v.x;
y += v.y;
@@ -31,3 +39,17 @@ Vertex& Vertex::operator-=(const Vertex &v) {
return *this;
}
+
+Vertex& Vertex::operator*=(float f) {
+ x *= f;
+ y *= f;
+
+ return *this;
+}
+
+Vertex& Vertex::operator/=(float f) {
+ x /= f;
+ y /= f;
+
+ return *this;
+}