@react-shimeji/core 0.3.4 → 0.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1778,7 +1778,8 @@ var Mascot = class {
1778
1778
  const isAhead = movingRight ? siblingCenterX >= previousCenterX : siblingCenterX <= previousCenterX;
1779
1779
  const overlapsVertically = currentBox.y < sibling.y + sibling.height && sibling.y < currentBox.y + currentBox.height;
1780
1780
  const crossesHorizontally = sweptLeft <= sibling.x + sibling.width && sibling.x <= sweptRight;
1781
- return isAhead && overlapsVertically && crossesHorizontally;
1781
+ const wasAlreadyOverlapping = overlapsVertically && previousBox.x < sibling.x + sibling.width && sibling.x < previousBox.x + previousBox.width;
1782
+ return isAhead && overlapsVertically && crossesHorizontally && !wasAlreadyOverlapping;
1782
1783
  });
1783
1784
  if (!collision) return;
1784
1785
  this.state.x = previous.x;