Whops fixed bug in duplicating layers

It's .children, not .childNodes, the second one also returns text elements (like \ns)
This commit is contained in:
unsettledgames 2020-09-17 12:41:47 +02:00
parent 2a5315b81a
commit c27a355904
2 changed files with 1 additions and 3 deletions

View File

@ -13,11 +13,9 @@ The next version is mostly focused on adding missing essential features and port
Suggestions / Planned features:
- Line tool
- Resize canvas
- Resize sprite
- Load palette from LPE file
- Move colours in (advanced) palette editor
- Duplicate layer
- Symmetry options
- Custom color picker

View File

@ -463,7 +463,7 @@ function deleteLayer(saveHistory = true) {
function duplicateLayer(event, saveHistory = true) {
let layerIndex = layers.indexOf(currentLayer);
let toDuplicate = currentLayer;
let menuEntries = layerList.childNodes
let menuEntries = layerList.children;
// Increasing z-indexes of the layers above
for (let i=getMenuEntryIndex(menuEntries, toDuplicate.menuEntry) - 1; i>0; i--) {