MergeCurrentLayerDown() public method

public MergeCurrentLayerDown ( ) : void
return void
Example #1
0
        private void HandlePintaCoreActionsLayersMergeLayerDownActivated(object sender, EventArgs e)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            PintaCore.Tools.Commit();

            CompoundHistoryItem    hist = new CompoundHistoryItem("Menu.Layers.MergeLayerDown.png", Catalog.GetString("Merge Layer Down"));
            DeleteLayerHistoryItem h1   = new DeleteLayerHistoryItem(string.Empty, string.Empty, doc.CurrentLayer, doc.CurrentLayerIndex);
            SimpleHistoryItem      h2   = new SimpleHistoryItem(string.Empty, string.Empty, doc.Layers[doc.CurrentLayerIndex - 1].Surface.Clone(), doc.CurrentLayerIndex - 1);

            hist.Push(h1);
            hist.Push(h2);

            doc.MergeCurrentLayerDown();

            doc.History.PushNewItem(hist);
        }