Select to view content in your preferred language

Undo Move Graphic

3024
10
07-19-2011 08:47 AM
MarkHoover
Frequent Contributor
Hello,

I have been successfully implementing the UndoManager for a variety of tasks, but I have gotten stuck and could use some help.

My UndoManager needs to be able to handle edits applied via the Edit Toolbar.  It works great for Scale and Rotate, but Move doesn't undo.

To implement this, my Undo and Redo actions have references to the old and new graphic (before and after the edit) and use Graphic.setGeometry(geometry) to undo/redo the actions.  Like I said, this works beautifully for Scale and Rotate, but my Moves don't Undo.

So my question is, is the graphic's location not stored in the geometry of a graphic?  Or is something else, unique to the positioning of a graphic, causing this to fail?

If anyone could provide any help, that would be great.

Thanks,
Mark
0 Kudos
10 Replies
MarkHoover
Frequent Contributor
Jian, your solution has done the trick!  Thank you so much.
0 Kudos