| 291 | } |
| 292 | |
| 293 | int UndoHistory::StartUndo() { |
| 294 | // Drop any trailing startAction |
| 295 | if (actions[currentAction].at == startAction && currentAction > 0) |
| 296 | currentAction--; |
| 297 | |
| 298 | // Count the steps in this action |
| 299 | int act = currentAction; |
| 300 | while (actions[act].at != startAction && act > 0) { |
| 301 | act--; |
| 302 | } |
| 303 | return currentAction - act; |
| 304 | } |
| 305 | |
| 306 | const Action &UndoHistory::GetUndoStep() const { |
| 307 | return actions[currentAction]; |