Text object requires to be finalized to enable Undo button
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pinta |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Pinta 1.8-dev on Ubuntu 20.04:
https:/
1. Select any tool from tololbar e.g. Line, Paintbrush, Rectangle etc.
2. Draw something on canvas.
3. Observe. Undo button appears as soon object e.g. rectangle is drawn on canvas and mouse released. This is expected behaviour. There is no requirement that object is in finalized state.
4. Now select Text and click on canvas.
5. Start typing. I expect as soon as I type in one single letter that Undo button on toolbar is enabled. But it is not (THE PROBLEM) and I am required to press ESC key or to click somewhere on the canvas to finalized the text. As soon as text is finalied the Undo button appears on toolbar. My expectation is as soon single letter is typed Undo should be enabled.
Now do another test:
1. New image.
2. Text from toolbar.
3. Click on canvas and type some text.
4. Observe. Undo button is not enabled.
5. With mouse click somewhere on the canvas.
6. Observe. Undo button is enabled now.
7. Type single letter and you see Undo button is still enabled. As expected.
8. Now Undo and undo works fine. As expected.
In second case it is clear you can undo single letter as soon as it is typed in, but in the first case, undo can be performed only after text finalize event is performed.
Additional info. I have tested this scenario:
a) Pinta 1.7.1
b) previous Pinta 1.8-dev before bug #1910495 where some undo fixes were applied to Text object
and problem in this bug report appears in both cases, so this must be an old issue.
This happens because the text tool commits a new history item in its OnHandleUndo() implementation, which is then immediately undone. The history item isn't there when editing starts which is why the undo button remains disabled