Skip to content

Commit e1a1be6

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 7c27d18 commit e1a1be6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/scaffolding/scaffolding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class Scaffolding extends EventTarget {
134134
_startDragging (x, y) {
135135
if (this._draggingId) return;
136136
const drawableId = this.renderer.pick(x, y);
137-
if (drawableId === null) return;
137+
if (drawableId === -1 || drawableId === false) return;
138138
const targetId = this.vm.getTargetIdForDrawableId(drawableId);
139139
if (targetId === null) return;
140140
const target = this.vm.runtime.getTargetById(targetId);

0 commit comments

Comments
 (0)