scribble-rs / scribble.rs

A skribbl.io alternative - Play at https://scribblers.fly.dev
BSD 3-Clause "New" or "Revised" License
370 stars 184 forks source link

Decide whether undo should only undo last action #279

Closed Bios-Marcel closed 1 year ago

Bios-Marcel commented 3 years ago

Initially I intended to implement undo as only the last "action". However, the question was, how to know what's an "action". What if someone accidentally double clicked the fill button, or drew a very long line and then a very short one and only the short one could be undone. Only the scenario where the user does a single canvas fill is easily recognizable. I even considered to only make the last fill undo-able. On top of that you can't undo everything, for example "canvas clear" isn't undo-able right now, as the drawing data is discarded irreversibly right now, as this was the most easy and least error-prone way to implement it.

So for now, people can undo all their last "actions", whereas an action is defined either by type of draw event ("line" / "fill") or time taken between events (>150ms).

I don't really know what the most user friendly solution would be here.

Bios-Marcel commented 1 year ago

I am satisfied with how it is for now. If there are concrete issues in the future, we'll revisit the topic.