DuplicateCurrentLayer() public method

public DuplicateCurrentLayer ( ) : Pinta.Core.UserLayer
return Pinta.Core.UserLayer
Example #1
0
        private void HandlePintaCoreActionsLayersDuplicateLayerActivated(object sender, EventArgs e)
        {
            Document doc = PintaCore.Workspace.ActiveDocument;

            PintaCore.Tools.Commit();

            Layer l = doc.DuplicateCurrentLayer();

            // Make new layer the current layer
            doc.SetCurrentLayer(l);

            AddLayerHistoryItem hist = new AddLayerHistoryItem("Menu.Layers.DuplicateLayer.png", Catalog.GetString("Duplicate Layer"), doc.Layers.IndexOf(l));

            doc.History.PushNewItem(hist);
        }