gabm / Satty

Satty - Modern Screenshot Annotation. A tool inspired by Swappy and Flameshot.
Mozilla Public License 2.0
486 stars 22 forks source link

ctrl + z weird undo behaviour #57

Closed Iss-in closed 6 months ago

Iss-in commented 7 months ago

So this is something i have noticed with text tool ,

if the tool is active, ie, i am typing something on the image using text tool, pressing ctrl+z while input field is active reverts any previous modification.

imo as long as input field is active, ctrl+z should do nothing or undo the last letter of text field input only .

gabm commented 7 months ago

yep.. that makes sense.. active tool - if any - should handle undo requests

Iss-in commented 7 months ago

so is this intended behaviour ? lets say i typed a text A on an image, and now in middle of typing text B on same image. while im typing text B, if i press ctrl+z , it will remove Text A , which should not happen.

what should happen -

gabm commented 7 months ago

no no.. it is obviously not intented.. I just stated the technical reasons for that behavior.

currently the undo action is unconditionally directed towards the "comitted drawables stack" (finished elements) and undoes the last action there. What actually should be done is: if there is an active tool (like the text tool that adds text), then that should handle the undo action. Only if there is no active tool, then it should remove the last commited drawable

gabm commented 6 months ago

this will be fixed with #67