From 46c9d3fe586fb5c8ac75384b62a79971f96a5b88 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Wed, 3 Aug 2016 17:43:25 -0300 Subject: Bus implemented, selection not working Selection to move fail --- Project/Element.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Project/Element.cpp') 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 -- cgit