summaryrefslogtreecommitdiffstats
path: root/Project/Load.cpp
diff options
context:
space:
mode:
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;
}