hide and show layers
This commit is contained in:
parent
528593d705
commit
f0e1a2910f
12
src/main.js
12
src/main.js
|
|
@ -1160,6 +1160,7 @@ class Layer {
|
|||
}
|
||||
this.name = "Layer"
|
||||
this.frames = [new Frame("keyframe", this.idx+"-F1")]
|
||||
this.visible = true
|
||||
pointerList[this.idx] = this
|
||||
}
|
||||
getFrame(num) {
|
||||
|
|
@ -1273,6 +1274,11 @@ class Layer {
|
|||
}
|
||||
return newLayer
|
||||
}
|
||||
toggleVisibility() {
|
||||
this.visible = !this.visible
|
||||
updateUI()
|
||||
updateMenu()
|
||||
}
|
||||
}
|
||||
|
||||
class AudioLayer {
|
||||
|
|
@ -1776,6 +1782,7 @@ class GraphicsObject {
|
|||
// this.currentFrameNum = 0;
|
||||
// }
|
||||
for (let layer of this.layers) {
|
||||
if (!layer.visible) continue;
|
||||
let frame = layer.getFrame(this.currentFrameNum)
|
||||
for (let shape of frame.shapes) {
|
||||
if (context.shapeselection.indexOf(shape) >= 0) {
|
||||
|
|
@ -3611,6 +3618,11 @@ async function updateMenu() {
|
|||
enabled: context.activeObject.layers.length > 1,
|
||||
action: actions.deleteLayer.create
|
||||
},
|
||||
{
|
||||
text: context.activeObject.activeLayer.visible ? "Hide Layer" : "Show Layer",
|
||||
enabled: true,
|
||||
action: () => {context.activeObject.activeLayer.toggleVisibility()}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue