Skip to content

Commit 2c4096c

Browse files
committed
Fix renderer.pick() miss return value
We were expecting null but Scratch returns false, TW returns -1 (what Scratch's comments say it should) Let's handle both to ensure maximum compatibility.
1 parent 4a3e83d commit 2c4096c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scaffolding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class Scaffolding extends EventTarget {
146146
_startDragging (x, y) {
147147
if (this._draggingId) return;
148148
const drawableId = this.renderer.pick(x, y);
149-
if (drawableId === null) return;
149+
if (drawableId === -1 || drawableId === false) return;
150150
const targetId = this.vm.getTargetIdForDrawableId(drawableId);
151151
if (targetId === null) return;
152152
const target = this.vm.runtime.getTargetById(targetId);

0 commit comments

Comments
 (0)