summaryrefslogtreecommitdiffstats
path: root/Project/Element.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project/Element.cpp')
-rw-r--r--Project/Element.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Project/Element.cpp b/Project/Element.cpp
index 984eb65..a485c82 100644
--- a/Project/Element.cpp
+++ b/Project/Element.cpp
@@ -63,3 +63,14 @@ wxPoint2DDouble Element::RotateAtPosition(wxPoint2DDouble pointToRotate, double
std::sin(radAngle) * (pointToRotate.m_x - m_position.m_x) +
std::cos(radAngle) * (pointToRotate.m_y - m_position.m_y) + m_position.m_y);
}
+
+void Element::StartMove(wxPoint2DDouble position)
+{
+ this->m_moveStartPt = position;
+ this->m_movePos = m_position;
+}
+
+void Element::Move(wxPoint2DDouble position)
+{
+ SetPosition(m_movePos + position - m_moveStartPt);
+} \ No newline at end of file