MapWindow / MapWindow5

MW5 is a desktop GIS which is extendable using the plug-in architecture. It is using the MapWinGIS mapping control and is created from scratch in 2015 using new technologies like MEF and Dependency Injection making it small in size, robust and fast.
290 stars 100 forks source link

Undo Command can not works correct At commit e566f91240b576a7b058d77c74424f0731f20b93 #140

Open ningfc opened 2 years ago

ningfc commented 2 years ago

I try to edit shape geometry and then click Undo button, but the edited shape not recover. This happend at commit e566f91240b576a7b058d77c74424f0731f20b93 MW5CORE-224 and later commits, And I test at commit 532e7099b09cfb18032710f873d9463ac6b2c3b7 MW5Core-222, it works OK.

ningfc commented 2 years ago

I debug and try, And then I realized something wrong. The Undo command not work, because UndoList.Add function call must before the function FeatureSet.EditDelete(i). Like this. `

    list.Add(UndoOperation.RemoveShape, layerHandle, i);
    features.EditDelete(i);

`

Don't like this. `

    features.EditDelete(i);
    list.Add(UndoOperation.RemoveShape, layerHandle, i);

` If you delete the shape first, and then add it to UndoList, but the shape index already delete, UndoList.Add will do nothing.