GNOME Bugzilla – Bug 318182
Undo does not restore size of automatically resized shapes
Last modified: 2011-06-13 20:09:04 UTC
Undo should restore the shape's original size Other information: To reproduce: - take a flowchart-square (first shape in folder) - type text like "123456789" (the shape enlarges itself to follow text length) - press Ctrl-Z (undo) several times =>the shape stays as large as for previous text
Actually this isn't a problem with undo. If you delete the text with backspace the shape doesn't resize either.
IMO this *is* a problem with undo. While typing (backspacing) magically snapping back to some previous size would be encountered as bug by me. For undo OTOH the 'contract is that everything - including the size - should be undone, i.e. restored to state before the action being undone. Though looking at the current code I'm not sure how to best achieve this.
I think the problem is in the function handle_key_event() in the file app/disp_callbacks.c, where obj->ops->move has a side effect of updating the object. These side effects should get recorded as Change objects.
this is very annoying bug. text editation of objects is undoable only by closing/reopening file.
Finally I've had an idea how to fix this: http://git.gnome.org/browse/dia/commit/?id=02f2ae578cdc56d359710000370b034f2e9db162 Also the the obj->ops->move() hack could probably be removed, but that'll be a different commit.