Open andrewphilipsmith opened 1 year ago
This was a problem introduced by #1085. It's possible we need to rethink the MapEdits
structure with flat commands right now, and be able to batch them together. Maybe something like EditCmd::Multiple(Vec<EditCmd>)
(ignoring the recursive type problem).
Ah, I slightly misread the issue -- a related problem is the use of the freehand filter tool. The user can introduce a bunch of new filters with one logical operation, but then has to undo filters individually (in an arbitrary order). That's another case where we'd want to logically batch edits.
How to reproduce
Expected behaviour
The user should be able to undo the filter placement with a single undo.
Actual behaviour
The user may need to select undo > 100 times in order to return to the state before automatically placing the filter.
(It seems that an edit is made and undone for each candidate filter (see https://github.com/a-b-street/abstreet/blob/70002600991c4611d3d905da59173c0b74cee2a6/apps/ltn/src/logic/auto_filters.rs#L105) (~= the number of interior roads in the neighbourhood). This can be > 100, making it impracticable for the user to undo this change later.