When undoing cells that have been crossed by dragging, it does not seem to follow a logical order.
Setup
(Demonstrated on the Level Builder for better visualization but the behaviour is the same on every available level.)
Place 3 crossed cells by click-dragging:

Resulting grid:

Crossed cells are numbered 1, 2 and 3, in the order they were added.
Then, press the "Undo" button 3 times in a row, without otherwise interacting with the grid.
Expected Behavior
Cells are uncrossed in the reverse order: 3 then 2 then 1.
After one "Undo":

Cell 3 is uncrossed.
After two "Undo":

Cell 2 is uncrossed.
After three "Undo":

Cell 1 is uncrossed, and the grid is empty, as it was before crossing the 3 cells.
Current Behavior
After one "Undo":

✅ Cell 3 is uncrossed.
After two "Undo":

❌ Cell 1 is uncrossed.
After three "Undo":

❌ Cell 2 is uncrossed.
This behaviour is encountered for any non-self-intersecting click-drag pattern, of any length (2+), drawn in any direction.
❌ For a pattern of length N, crosses are removed in the order N, N-1, N-2, ... 1, 2.
✅ We would expect crosses to be removed in the order N, N-1, N-2, ... 2, 1.
NB: self-intersecting patterns behave weirdly too, but I let the developper explore the issue. Example of pattern with weird undoing sequence, traced in a single click-drag (pattern starts at the circle):

When undoing cells that have been crossed by dragging, it does not seem to follow a logical order.
Setup
(Demonstrated on the Level Builder for better visualization but the behaviour is the same on every available level.)
Place 3 crossed cells by click-dragging:

Resulting grid:

Crossed cells are numbered 1, 2 and 3, in the order they were added.
Then, press the "Undo" button 3 times in a row, without otherwise interacting with the grid.
Expected Behavior
Cells are uncrossed in the reverse order: 3 then 2 then 1.
After one "Undo":

Cell 3 is uncrossed.
After two "Undo":

Cell 2 is uncrossed.
After three "Undo":

Cell 1 is uncrossed, and the grid is empty, as it was before crossing the 3 cells.
Current Behavior
After one "Undo":

✅ Cell 3 is uncrossed.
After two "Undo":

❌ Cell 1 is uncrossed.
After three "Undo":

❌ Cell 2 is uncrossed.
This behaviour is encountered for any non-self-intersecting click-drag pattern, of any length (2+), drawn in any direction.
❌ For a pattern of length N, crosses are removed in the order N, N-1, N-2, ... 1, 2.
✅ We would expect crosses to be removed in the order N, N-1, N-2, ... 2, 1.
NB: self-intersecting patterns behave weirdly too, but I let the developper explore the issue. Example of pattern with weird undoing sequence, traced in a single click-drag (pattern starts at the circle):