public override void Undo()
        {
            // maintain the current scaling setting after the operation
            double scale = PintaCore.Workspace.Scale;

            Size swap = PintaCore.Workspace.ImageSize;

            PintaCore.Workspace.ImageSize  = old_size;
            PintaCore.Workspace.CanvasSize = old_size;

            old_size = swap;

            base.Undo();

            if (RestoreSelection != null)
            {
                DocumentSelection old = PintaCore.Workspace.ActiveDocument.Selection;
                PintaCore.Workspace.ActiveDocument.Selection = RestoreSelection.Clone();

                if (old != null)
                {
                    old.Dispose();
                }

                PintaCore.Layers.ShowSelection = true;
            }
            else
            {
                PintaCore.Layers.ResetSelectionPath();
            }

            PintaCore.Workspace.Invalidate();

            PintaCore.Workspace.Scale = scale;
        }
Exemple #2
0
        // Clean up any native resources we had
        public void Close()
        {
            // Dispose all of our layers
            while (UserLayers.Count > 0)
            {
                Layer l = UserLayers[UserLayers.Count - 1];
                UserLayers.RemoveAt(UserLayers.Count - 1);
                (l.Surface as IDisposable).Dispose();
            }

            current_layer = -1;

            if (tool_layer != null)
            {
                (tool_layer.Surface as IDisposable).Dispose();
            }

            if (selection_layer != null)
            {
                (selection_layer.Surface as IDisposable).Dispose();
            }

            Selection.Dispose();
            PreviousSelection.Dispose();

            Workspace.History.Clear();
        }
Exemple #3
0
        public override void Dispose()
        {
            base.Dispose();

            if (RestoreSelection != null)
            {
                RestoreSelection.Dispose();
            }
        }
Exemple #4
0
        // Clean up any native resources we had
        public void Close()
        {
            Layers.Close();

            Selection.Dispose();
            PreviousSelection.Dispose();

            Workspace.History.Clear();
        }
Exemple #5
0
        public override void Dispose()
        {
            old_selection.Dispose();

            if (old_surface != null)
            {
                (old_surface as IDisposable).Dispose();
            }
        }
Exemple #6
0
        public override void Dispose()
        {
            if (paste_image != null)
            {
                (paste_image as IDisposable).Dispose();
            }

            if (old_selection != null)
            {
                old_selection.Dispose();
            }
        }
Exemple #7
0
        public override void Undo()
        {
            var doc = PintaCore.Workspace.ActiveDocument;

            // maintain the current scaling setting after the operation
            double scale = PintaCore.Workspace.Scale;

            Size swap = PintaCore.Workspace.ImageSize;

            var window = PintaCore.Workspace.ActiveWorkspace.Canvas.Window;

            window.FreezeUpdates();

            PintaCore.Workspace.ImageSize  = old_size;
            PintaCore.Workspace.CanvasSize = old_size;

            old_size = swap;

            base.Undo();

            if (RestoreSelection != null)
            {
                DocumentSelection old = PintaCore.Workspace.ActiveDocument.Selection;
                doc.Selection = RestoreSelection.Clone();

                if (old != null)
                {
                    old.Dispose();
                }
            }
            else
            {
                doc.ResetSelectionPaths();
            }

            PintaCore.Workspace.Invalidate();

            PintaCore.Workspace.Scale = scale;
            PintaCore.Actions.View.UpdateCanvasScale();

            window.ThawUpdates();
        }
Exemple #8
0
 public override void Dispose()
 {
     old_selection.Dispose();
     old_previous_selection.Dispose();
 }