Permalink
Browse files

Merge pull request #56 from ericksson/master

[Fix for bug #1175733] Update layer preview after pasting.
  • Loading branch information...
2 parents a9893df + 6a6075d commit ff2c273610860724067a1417f4672b53151df4f6 @cameronwhite cameronwhite committed May 5, 2013
Showing with 11 additions and 8 deletions.
  1. +8 −5 Pinta.Core/Classes/Document.cs
  2. +1 −1 Pinta.Core/Managers/LayerManager.cs
  3. +2 −2 Pinta.Tools/Tools/MoveSelectedTool.cs
@@ -388,7 +388,7 @@ public UserLayer DuplicateCurrentLayer()
return layer;
}
- public void FinishSelection ()
+ public void FinishSelection (CompoundHistoryItem compoundAction)
{
// We don't have an uncommitted layer, abort
if (!ShowSelectionLayer)
@@ -406,7 +406,11 @@ public void FinishSelection ()
DestroySelectionLayer ();
Workspace.Invalidate ();
- Workspace.History.PushNewItem (hist);
+ if (compoundAction != null) {
+ compoundAction.Push (hist);
+ } else {
+ Workspace.History.PushNewItem (hist);
+ }
}
// Flatten image
@@ -837,10 +841,9 @@ public void Paste (bool toNewLayer, int x = 0, int y = 0)
Selection.SelectionPath = p;
Selection.SelectionPolygons.Clear();
ShowSelection = true;
-
- Workspace.Invalidate ();
-
+
paste_action.Push (new PasteHistoryItem (cbImage, old_selection, old_show_selection));
+ FinishSelection(paste_action);
History.PushNewItem (paste_action);
}
@@ -97,7 +97,7 @@ public void SetCurrentLayer(UserLayer layer)
public void FinishSelection ()
{
- PintaCore.Workspace.ActiveDocument.FinishSelection ();
+ PintaCore.Workspace.ActiveDocument.FinishSelection (null);
}
// Adds a new layer above the current one
@@ -137,7 +137,7 @@ protected override void OnFinishTransform ()
protected override void OnCommit ()
{
try {
- PintaCore.Workspace.ActiveDocument.FinishSelection ();
+ PintaCore.Workspace.ActiveDocument.FinishSelection (null);
} catch (Exception) {
// Ignore an error where ActiveDocument fails.
}
@@ -147,7 +147,7 @@ protected override void OnDeactivated ()
{
base.OnDeactivated ();
- PintaCore.Workspace.ActiveDocument.FinishSelection ();
+ PintaCore.Workspace.ActiveDocument.FinishSelection (null);
}
}
}

0 comments on commit ff2c273

Please sign in to comment.