fix(ui): various things listening when they need not listen

This commit is contained in:
psychedelicious 2024-08-19 23:26:21 +10:00
parent 0839eac0f7
commit 4b609251e1
3 changed files with 6 additions and 5 deletions

View File

@ -235,6 +235,7 @@ export class CanvasBbox {
const toolState = this.manager.stateApi.getToolState(); const toolState = this.manager.stateApi.getToolState();
this.konva.group.visible(true); this.konva.group.visible(true);
this.parent.getLayer().listening(toolState.selected === 'bbox');
this.konva.group.listening(toolState.selected === 'bbox'); this.konva.group.listening(toolState.selected === 'bbox');
this.konva.rect.setAttrs({ this.konva.rect.setAttrs({
x: bbox.rect.x, x: bbox.rect.x,

View File

@ -21,7 +21,7 @@ export class CanvasPreview {
constructor(manager: CanvasManager) { constructor(manager: CanvasManager) {
this.manager = manager; this.manager = manager;
this.konva = { this.konva = {
layer: new Konva.Layer({ listening: true, imageSmoothingEnabled: false }), layer: new Konva.Layer({ listening: false, imageSmoothingEnabled: false }),
}; };
this.stagingArea = new CanvasStagingArea(this); this.stagingArea = new CanvasStagingArea(this);

View File

@ -55,9 +55,9 @@ export class CanvasTool {
this.path = this.manager.path.concat(this.id); this.path = this.manager.path.concat(this.id);
this.log = this.manager.buildLogger(this.getLoggingContext); this.log = this.manager.buildLogger(this.getLoggingContext);
this.konva = { this.konva = {
group: new Konva.Group({ name: `${this.type}:group` }), group: new Konva.Group({ name: `${this.type}:group`, listening: false }),
brush: { brush: {
group: new Konva.Group({ name: `${this.type}:brush_group` }), group: new Konva.Group({ name: `${this.type}:brush_group`, listening: false }),
fillCircle: new Konva.Circle({ fillCircle: new Konva.Circle({
name: `${this.type}:brush_fill_circle`, name: `${this.type}:brush_fill_circle`,
listening: false, listening: false,
@ -79,7 +79,7 @@ export class CanvasTool {
}), }),
}, },
eraser: { eraser: {
group: new Konva.Group({ name: `${this.type}:eraser_group` }), group: new Konva.Group({ name: `${this.type}:eraser_group`, listening: false }),
fillCircle: new Konva.Circle({ fillCircle: new Konva.Circle({
name: `${this.type}:eraser_fill_circle`, name: `${this.type}:eraser_fill_circle`,
listening: false, listening: false,
@ -103,7 +103,7 @@ export class CanvasTool {
}), }),
}, },
eyeDropper: { eyeDropper: {
group: new Konva.Group({ name: `${this.type}:eyeDropper_group` }), group: new Konva.Group({ name: `${this.type}:eyeDropper_group`, listening: false }),
fillCircle: new Konva.Circle({ fillCircle: new Konva.Circle({
name: `${this.type}:eyeDropper_fill_circle`, name: `${this.type}:eyeDropper_fill_circle`,
listening: false, listening: false,