Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes bug #1064018] Data lost when pasting images onto smaller canvases #35

Merged
merged 5 commits into from Nov 10, 2012
Merged

Conversation

don-mccomb
Copy link
Contributor

Modified code in the PasteAction to create a selection layer of the same size as the image data on the clipboard.

Copied a lot of the code from the PasteAction to the PasteIntoNewLayerAction. Modified this code to create and work on a new layer.

@cameronwhite
Copy link
Member

Thanks for the pull request!

With these changes, there isn't much of a difference between the code for Paste and Paste Into New Layer anymore. I think it would be good to eliminate the duplicated code and just have a common function that handles the pasting (and has a boolean argument for whether to create a new layer).

@don-mccomb
Copy link
Contributor Author

I agree. Will see what I can do tonight.

…ses. Simplified PasteIntoNewLayer. It now activates the plain Paste action.
@don-mccomb
Copy link
Contributor Author

I've replaced the majority of the code in the Activated method of the PasteIntoNewLayerAction class with code to activate the AddNewLayer and Paste actions. Much cleaner. The only downside is that it creates 2 separate entries in the History: one for the AddNewLayer action and another for the Paste action.

@don-mccomb
Copy link
Contributor Author

While I like the cleanness of the code in my last commit, the user experience is subpar. The user should not have to undo twice to undo the PasteIntoNewLayerAction. Will modify...

@cameronwhite
Copy link
Member

Just have the one comment above, but it looks good otherwise.

cameronwhite added a commit that referenced this pull request Nov 10, 2012
[Fixes bug #1064018] Data lost when pasting images onto smaller canvases.
@cameronwhite cameronwhite merged commit 5ccaf12 into PintaProject:master Nov 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants