GoUndoManager records incremental moves

When moving a selection by dragging, the undo manager records a lot of intermediate moves in the resulting compound edit, where really only one move operation is needed for each object (and child object) in the selection.

How would you recommend aggregating the incremental move operations ?
Is it in a GoUndoManager.CommitCompoundEdit override ? (this would still collect the incremental moves in the CurrentEdit, but at least not commit them).
Or would you use a GoToolDragging override (DoDragging, DoMouseMove....) or GoView override to prevent the incremental moves from getting recorded ?
Can you give an example of code achieving this ?

Very good – yes, GoUndoManager.CommitCompoundEdit is the right place to implement such an optimization.

In fact, we have intended to do exactly this optimization, and perhaps some others, in a future release.

Basically, you’d want to keep the first and the last GoChangedEventArgs that have the same values for the Document and Object properties, and that have the Hint be GoLayer.ChangedObject and that have the SubHint be GoObject.ChangedBounds. But you could throw away those unneeded intermediate GoChangedEventArgs for each GoObject.

I can’t find any such code lying around here, but it ought to be straight-forward to implement.