Text object requires to be finalized to enable Undo button

Bug #1952507 reported by grofaty
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Confirmed
Undecided
Unassigned

Bug Description

Pinta 1.8-dev on Ubuntu 20.04:
https://github.com/PintaProject/Pinta/actions/runs/1509112422

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.

Tags: text-tool
Revision history for this message
Cameron White (cameronwhite91) wrote :

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

Changed in pinta:
status: New → Confirmed
tags: added: text-tool
Revision history for this message
NM64 (nm64) wrote :

I don't suppose this issue is also why undo always undoes the entire text object and does not partially undo it?

The main issue I noticed is if I finalized the text but made a type or something and wanted to redo it, but pressing undo removes it completely including even the positioning of the text object meaning I have to start from scratch by placing and positioning the text object once again (let alone typing its contents).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.