Exemplo n.º 1
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.DisposeSelection();

            Workspace.History.Clear();
        }
Exemplo n.º 2
0
        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.DisposeSelection();
                }

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

            PintaCore.Workspace.Invalidate();

            PintaCore.Workspace.Scale = scale;
        }
Exemplo n.º 3
0
        public override void Dispose()
        {
            base.Dispose();

            if (RestoreSelection != null)
            {
                RestoreSelection.DisposeSelection();
            }
        }
Exemplo n.º 4
0
        public override void Dispose()
        {
            old_selection.DisposeSelection();

            if (old_surface != null)
            {
                (old_surface as IDisposable).Dispose();
            }
        }
Exemplo n.º 5
0
        public override void Dispose()
        {
            if (paste_image != null)
            {
                (paste_image as IDisposable).Dispose();
            }

            if (old_selection != null)
            {
                old_selection.DisposeSelection();
            }
        }
Exemplo n.º 6
0
 public override void Dispose()
 {
     old_selection.DisposeSelection();
 }