mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 15:02:52 -05:00
Merge pull request #1040 from paulkaplan/filter-dragging-touching
Filter out dragging targets from touching sprite check.
This commit is contained in:
commit
2478f2ff8b
1 changed files with 5 additions and 1 deletions
|
@ -734,7 +734,11 @@ class RenderedTarget extends Target {
|
||||||
if (!firstClone || !this.renderer) {
|
if (!firstClone || !this.renderer) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const drawableCandidates = firstClone.sprite.clones.map(clone => clone.drawableID);
|
// Filter out dragging targets. This means a sprite that is being dragged
|
||||||
|
// can detect other sprites using touching <sprite>, but cannot be detected
|
||||||
|
// by other sprites while it is being dragged. This matches Scratch 2.0 behavior.
|
||||||
|
const drawableCandidates = firstClone.sprite.clones.filter(clone => !clone.dragging)
|
||||||
|
.map(clone => clone.drawableID);
|
||||||
return this.renderer.isTouchingDrawables(
|
return this.renderer.isTouchingDrawables(
|
||||||
this.drawableID, drawableCandidates);
|
this.drawableID, drawableCandidates);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue