Element editor : Add animation for some undo/redo

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4060 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2015-07-20 21:06:00 +00:00
parent 50d98b2167
commit 012ba2ccd7
17 changed files with 278 additions and 39 deletions

View File

@@ -103,13 +103,16 @@ bool ESEventAddPolygon::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
* @param event
* @return
*/
bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
if (event -> button() == Qt::LeftButton) {
if (m_polygon) {
m_polygon -> addPoint(m_scene -> snapToGrid(event -> scenePos()));
bool ESEventAddPolygon::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
{
if (event -> button() == Qt::LeftButton)
{
if (m_polygon)
{
m_polygon->removeLastPoint();
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Polygone"), m_scene, m_polygon));
//Set m_polygon to nullptr for create new polygon at next mouse press
//Set m_polygon to nullptr for create new polygon at next mouse press
m_polygon = nullptr;
return true;
}