Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Pinta.Core/Actions/LayerActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ private void HandlePintaCoreActionsLayersAddNewLayerActivated (object sender, Ev

UserLayer l = doc.Layers.AddNewLayer (string.Empty);

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

AddLayerHistoryItem hist = new (
Resources.Icons.LayerNew,
Translations.GetString ("Add New Layer"),
Expand Down
11 changes: 5 additions & 6 deletions Pinta.Core/Classes/DocumentLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Layer ToolLayer {

/// <summary>
/// Creates a new layer and adds it to the Layer collection after the
/// currently selected layer.
/// currently selected layer, making it the new selected layer.
/// </summary>
public UserLayer AddNewLayer (string name)
{
Expand All @@ -91,14 +91,12 @@ public UserLayer AddNewLayer (string name)
? CreateLayer ()
: CreateLayer (name);

user_layers.Insert (CurrentUserLayerIndex + 1, layer);

if (user_layers.Count == 1)
CurrentUserLayerIndex = 0;
user_layers.Insert (++CurrentUserLayerIndex, layer);

layer.PropertyChanged += RaiseLayerPropertyChangedEvent;

LayerAdded?.Invoke (this, new IndexEventArgs (user_layers.Count - 1));
LayerAdded?.Invoke (this, new IndexEventArgs (CurrentUserLayerIndex));
SelectedLayerChanged?.Invoke (this, EventArgs.Empty);

return layer;
}
Expand Down Expand Up @@ -218,6 +216,7 @@ public UserLayer DuplicateCurrentLayer ()
layer.PropertyChanged += RaiseLayerPropertyChangedEvent;

LayerAdded?.Invoke (this, new IndexEventArgs (CurrentUserLayerIndex));
SelectedLayerChanged?.Invoke (this, EventArgs.Empty);

return layer;
}
Expand Down
13 changes: 6 additions & 7 deletions Pinta/Actions/Edit/PasteAction.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
//
//
// PasteAction.cs
//
//
// Author:
// Jonathan Pobst <monkey@jpobst.com>
// Cameron White <cameronwhite91@gmail.com>
//
//
// Copyright (c) 2012 Jonathan Pobst, Cameron White
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -170,7 +170,6 @@ public static async void Paste (
// layer and record it's creation in the history
if (toNewLayer) {
var l = doc.Layers.AddNewLayer (string.Empty);
doc.Layers.SetCurrentUserLayer (l);
paste_action.Push (new AddLayerHistoryItem (Resources.Icons.LayerNew, Translations.GetString ("Add New Layer"), doc.Layers.IndexOf (l)));
}

Expand Down
Loading