From 09c68fd8478e86b2b60d2d9b0d016bd6e2f647b9 Mon Sep 17 00:00:00 2001 From: unsettledgames <47360416+unsettledgames@users.noreply.github.com> Date: Fri, 18 Sep 2020 12:32:59 +0200 Subject: [PATCH] Fixed bug in duplicating layers --- js/_layer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/_layer.js b/js/_layer.js index ff3311a..da9853c 100644 --- a/js/_layer.js +++ b/js/_layer.js @@ -486,7 +486,7 @@ function duplicateLayer(event, saveHistory = true) { let menuEntries = layerList.children; // Increasing z-indexes of the layers above - for (let i=getMenuEntryIndex(menuEntries, toDuplicate.menuEntry) - 1; i>0; i--) { + for (let i=getMenuEntryIndex(menuEntries, toDuplicate.menuEntry) - 1; i>=0; i--) { getLayerByID(menuEntries[i].id).canvas.style.zIndex++; } maxZIndex++;