Skip to content

Commit

Permalink
Start stage listen even if no shapes, fixes #1819
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Dec 4, 2024
1 parent c15351c commit 95ea9a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/drawLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ export class DrawLayer {
activateCurrentPositionShapes(flag) {
const konvaLayer = this.getKonvaLayer();

// stop listening
// stop stage listening
this.#konvaStage.listening(false);

if (typeof this.#shapeHandler !== 'undefined') {
Expand All @@ -637,12 +637,13 @@ export class DrawLayer {
const drawController = this.getDrawController();
if (flag &&
drawController.getAnnotationGroup().isEditable()) {
// start stage listening
this.#konvaStage.listening(true);
// shape groups at the current position
const shapeGroups =
this.getCurrentPosGroup().getChildren();
// listen if we have shapes
if (shapeGroups.length !== 0) {
this.#konvaStage.listening(true);
konvaLayer.listening(true);
}
// add listeners for position group
Expand Down

0 comments on commit 95ea9a1

Please sign in to comment.