Skip to content

Commit

Permalink
Merge pull request #1040 from paulkaplan/filter-dragging-touching
Browse files Browse the repository at this point in the history
Filter out dragging targets from touching sprite check.
  • Loading branch information
paulkaplan committed Apr 11, 2018
2 parents 631d7fb + 92d00b5 commit 2478f2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/sprites/rendered-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2478f2f

Please sign in to comment.