[qet] [2892] Basic Shapes: Undo/Redo command added

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2892
Author:   abhishekm71
Date:     2014-03-01 08:30:11 +0100 (Sat, 01 Mar 2014)
Log Message:
-----------
Basic Shapes: Undo/Redo command added

Modified Paths:
--------------
    trunk/sources/diagramview.cpp

Modified: trunk/sources/diagramview.cpp
===================================================================
--- trunk/sources/diagramview.cpp	2014-03-01 06:14:58 UTC (rev 2891)
+++ trunk/sources/diagramview.cpp	2014-03-01 07:30:11 UTC (rev 2892)
@@ -461,9 +461,6 @@
 				rubber_band_origin = mapToScene(e -> pos());
 				newItem = new QetShapeItem(rubber_band_origin, rubber_band_origin, QetShapeItem::Line, false);
 				scene -> addItem(newItem);
-				// le place a la position pos en gerant l'annulation
-				//scene -> undoStack().push(new AddShapeCommand(scene, newItem, e->pos));
-				//adjustSceneRect();
 				break;
 			case addingRectangle:
 				rubber_band_origin = mapToScene(e -> pos());
@@ -528,6 +525,9 @@
 	}
 	if (current_behavior == addingLine || current_behavior == addingRectangle || current_behavior == addingEllipse) {
 		newItem -> setFullyBuilt(true);
+		// le place a la position pos en gerant l'annulation
+		scene -> undoStack().push(new AddShapeCommand(scene, newItem, rubber_band_origin));
+		adjustSceneRect();
 		if (current_behavior == addingLine)
 			emit(LineAdded(false));
 		else if (current_behavior == addingRectangle)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/