summaryrefslogtreecommitdiffstats
path: root/Project/Load.cpp
diff options
context:
space:
mode:
authorThales1330 <thaleslima.ufu@gmail.com>2016-09-06 18:32:47 -0300
committerThales1330 <thaleslima.ufu@gmail.com>2016-09-06 18:32:47 -0300
commit697baaa3cc92e945d2301238dc9bcabffdb465ef (patch)
tree01f3de93600a1036c8d693c5c8150434ebf75731 /Project/Load.cpp
parentd93ef357da510f2515556ff2cb51688a4e068805 (diff)
downloadPSP.git-697baaa3cc92e945d2301238dc9bcabffdb465ef.tar.gz
PSP.git-697baaa3cc92e945d2301238dc9bcabffdb465ef.tar.xz
PSP.git-697baaa3cc92e945d2301238dc9bcabffdb465ef.zip
Counter clockwise rotation implemented
Diffstat (limited to 'Project/Load.cpp')
-rw-r--r--Project/Load.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/Project/Load.cpp b/Project/Load.cpp
index b5c5948..92a98d3 100644
--- a/Project/Load.cpp
+++ b/Project/Load.cpp
@@ -87,18 +87,22 @@ void Load::Draw(wxPoint2DDouble translation, double scale) const
}
}
-void Load::Rotate()
+void Load::Rotate(bool clockwise)
{
- m_angle += m_rotationAngle;
- m_pointList[2] = RotateAtPosition(m_pointList[2], m_rotationAngle);
- m_pointList[3] = RotateAtPosition(m_pointList[3], m_rotationAngle);
+ double rotAngle = m_rotationAngle;
+ if(!clockwise) rotAngle = -m_rotationAngle;
+
+ m_angle += rotAngle;
+ m_pointList[2] = RotateAtPosition(m_pointList[2], rotAngle);
+ m_pointList[3] = RotateAtPosition(m_pointList[3], rotAngle);
UpdateSwitchesPosition();
}
bool Load::GetContextMenu(wxMenu& menu)
{
menu.Append(ID_EDIT_LOAD, _("Edit Load"));
- menu.Append(ID_ROTATE, _("Rotate"));
+ menu.Append(ID_ROTATE_CLOCK, _("Rotate clockwise"));
+ menu.Append(ID_ROTATE_COUNTERCLOCK, _("Rotate counter-clockwise"));
menu.Append(ID_DELETE, _("Delete"));
return true;
}