fix(ui): layer visibility toggle

This commit is contained in:
psychedelicious 2024-07-31 20:53:46 +10:00
parent 078908fbea
commit cce6bf9428

View File

@ -268,7 +268,7 @@ export class CanvasLayer extends CanvasEntity {
this._log.trace('Updating visibility');
const isEnabled = get(arg, 'isEnabled', this._state.isEnabled);
const hasObjects = this.objects.size > 0 || this._drawingBuffer !== null;
this.konva.layer.visible(isEnabled || hasObjects);
this.konva.layer.visible(isEnabled && hasObjects);
}
updatePosition(arg?: { position: Coordinate }) {