From acb1721e94a49a4941bb11dfc2f832c3848aa204 Mon Sep 17 00:00:00 2001 From: neoraider Date: Fri, 8 Feb 2008 21:21:01 +0000 Subject: zoomedit: Implemented Rotate tool; added simple gates. --- Vertex.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Vertex.cpp') 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; +} -- cgit v1.2.3