Two undo actions required to single Undo after pasting image

Bug #996490 reported by grofaty
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Pinta
Fix Released
High
Cameron White

Bug Description

Pinta 1.3 on Windows XP:
1. New image: 300 x 300 px.
2. <Print-screen> and paste the image to Pinta using <Ctrl>+V.
3. Dialog appears. Click on "Expand canvas" button.
4. Click on Undo and you will notice canvas size is still in the size of pasted image with transparent background. Clicking undo again and picture gets into pre-pasting state.

So it looks like two undo actions must be performed to get an undo.

Revision history for this message
Cameron White (cameronwhite91) wrote :

Confirmed on Ubuntu 12.04 with latest development version.

Changed in pinta:
importance: Undecided → High
milestone: none → 1.4
status: New → Confirmed
Nethra (netra-pes)
Changed in pinta:
assignee: nobody → Nethra (netra-pes)
Revision history for this message
Nethra (netra-pes) wrote :
Revision history for this message
Robert Nordan (rpvn) wrote :

Hi Nethra, sorry it took a while for one of us to respond. It's super cool that you fixed this! But we can't really do anything with a fix that is submitted as a plain unix diff, because a) there is no version control information in it that says which checkout from git you've made the changes from, b) it contains references to local file paths like "/home/nethra", and c) it also diffs lots of compiled files that don't go into version control. So we can't really do anything with a patch file like this, since it's too hard for us to see what you actually did to fix the problem. :-(

Therefore it would be really nice if you could follow the steps on this page: http://pinta-project.com/contribute.ashx#Patches_and_Fixes_7 :-) Once you have your changes available as a github pull request, we'd love to inspect them and merge them in! (Again, thanks for taking time to fix the problem, now we just need you to take a little more time to get it merged in!) ;-)

Revision history for this message
Cameron White (cameronwhite91) wrote :

Fixed: https://github.com/PintaProject/Pinta/commit/9a75ac7d9758127e4d502e9321855ed4ce61f7f8

This change uses a CompoundHistoryItem to merge the Resize Canvas and Paste history items into a single undoable action, which is cleaner than adding special cases into the DocumentWorkspaceHistory code.

Changed in pinta:
assignee: Nethra (netra-pes) → Cameron White (cameronwhite91)
status: Confirmed → Fix Committed
Revision history for this message
grofaty (grofaty) wrote :

I have tested this fix on Ubuntu 12.04 with latest Pinta development and I see undo is now working fine. The only think that is strange is that when pressing Undo button first transparent background image is displayed for about half of second (old computer) and right after that original 300x300 image is displayed. Final result (display of 300x300 image) is OK, what is little bit confusing to end-user is intermediate "transparent background image". This looks like Pinta v1.3 pressing Undo once and then Undo one more time - so see intermediate action. It looks just like end-user has pressed something twice, because it appears two actions were made.

Is there any way to hide intermediate "transparent background image" appearance? You now just for sake of simplicity, not displaying the things end-user doesn't need to see.

Revision history for this message
Cameron White (cameronwhite91) wrote :

This is because the new history item is composed of two history items, each of which triggers a re-paint of the canvas. On my (fairly new) computer, the transition is almost instant but still noticeable. Maybe we should move this into another bug (since it is lower priority than the original bug?)

Revision history for this message
grofaty (grofaty) wrote :

I agree. I reported a new bug 1046162.

grofaty (grofaty)
Changed in pinta:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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