diff --git a/index.html b/index.html index 9305bc5..7e1ddb9 100644 --- a/index.html +++ b/index.html @@ -355,7 +355,7 @@ src="js/lib/workspaces.js?v=4fbd55b" type="text/javascript"> - + diff --git a/js/lib/layers.d.js b/js/lib/layers.d.js index b847fd7..cd331cd 100644 --- a/js/lib/layers.d.js +++ b/js/lib/layers.d.js @@ -38,7 +38,7 @@ * @property {Point} inputOffset The offset for calculating layer coordinates from input element input information * @property {Point} origin The location of the origin ((0, 0) point) of the collection (If canvas goes from -64, -32 to 128, 512, it's (64, 32)) * @property {BoundingBox} bb The current bounding box of the collection, in layer coordinates - * @property {{[key: string]: Layer}} layers An object for quick access to named layers of the collection + * @property {{[key: string]: Layer}} layers An object for quick access to layers of the collection * @property {Size} size The size of the collection (CSS) * @property {Size} resolution The resolution of the collection (canvas) * @property {function} expand Expands the collection and its full layers by the specified amounts diff --git a/js/lib/layers.js b/js/lib/layers.js index 3c513cd..3e28ee9 100644 --- a/js/lib/layers.js +++ b/js/lib/layers.js @@ -618,6 +618,7 @@ const layers = { collection._layers.splice(index, 0, layer); } if (key) collection.layers[key] = layer; + collection.layers[id] = layer; if (key === null) console.debug( @@ -651,7 +652,8 @@ const layers = { layers.listen.onlayerdelete.emit({ layer: lobj, }); - if (lobj.key) delete collection.layers[lobj.key]; + if (lobj.key) collection.layers[lobj.key] = undefined; + collection.layers[lobj.id] = undefined; collection.element.removeChild(lobj.canvas);