Skip to content

Commit

Permalink
Fix #1883623 where the canvas size could shrink in one dimension when…
Browse files Browse the repository at this point in the history
… pasting.
  • Loading branch information
cameronwhite committed Jul 18, 2020
1 parent c3d4892 commit b07539c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Thanks to the following contributors who worked on this release:
- Cairo blend operations are now used instead of PDN's managed blend modes (#98, [#1248933](https://bugs.launchpad.net/pinta/+bug/1248933), [#1091910](https://bugs.launchpad.net/pinta/+bug/1091910)).

### Fixed
- The option to expand the canvas when pasting an image now only changes the canvas size in the dimension where the pasted image is larger ([#1883623](https://bugs.launchpad.net/pinta/+bug/1883623)).
- Fixed a bug where Auto Crop used the current layer instead of the entire image when deciding what to crop, and takes the selection into account ([#1434928](https://bugs.launchpad.net/pinta/+bug/1434928), [#1434906](https://bugs.launchpad.net/pinta/+bug/1434906)).
- Fixed potential crashes when switching tools without any open documents ([#1425612](https://bugs.launchpad.net/pinta/+bug/1425612)).
- Fixed a potential bug where the OK button in the New Image dialog could be incorrectly disabled ([#1430203](https://bugs.launchpad.net/pinta/+bug/1430203)).
Expand Down
7 changes: 4 additions & 3 deletions Pinta.Core/Classes/Document.cs
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,10 @@ public void Paste (bool toNewLayer, int x = 0, int y = 0)

if (response == ResponseType.Accept)
{
PintaCore.Workspace.ResizeCanvas (cbImage.Width, cbImage.Height,
Pinta.Core.Anchor.Center, paste_action);
PintaCore.Actions.View.UpdateCanvasScale ();
var new_width = Math.Max(canvas_size.Width, cbImage.Width);
var new_height = Math.Max(canvas_size.Height, cbImage.Height);
PintaCore.Workspace.ResizeCanvas(new_width, new_height, Pinta.Core.Anchor.Center, paste_action);
PintaCore.Actions.View.UpdateCanvasScale ();
}
else if (response == ResponseType.Cancel || response == ResponseType.DeleteEvent)
{
Expand Down

0 comments on commit b07539c

Please sign in to comment.