mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Filter out dragging targets from touching sprite check.
This introduces an asymmetry that matches the Scratch 2 behavior, that is, 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 commit is contained in:
parent
d177f4cd0c
commit
92d00b5944
1 changed files with 5 additions and 1 deletions
|
@ -734,7 +734,11 @@ class RenderedTarget extends Target {
|
|||
if (!firstClone || !this.renderer) {
|
||||
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(
|
||||
this.drawableID, drawableCandidates);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue