@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.cjs CHANGED
@@ -1825,7 +1825,8 @@ var Mascot = class {
1825
1825
  const isAhead = movingRight ? siblingCenterX >= previousCenterX : siblingCenterX <= previousCenterX;
1826
1826
  const overlapsVertically = currentBox.y < sibling.y + sibling.height && sibling.y < currentBox.y + currentBox.height;
1827
1827
  const crossesHorizontally = sweptLeft <= sibling.x + sibling.width && sibling.x <= sweptRight;
1828
- return isAhead && overlapsVertically && crossesHorizontally;
1828
+ const wasAlreadyOverlapping = overlapsVertically && previousBox.x < sibling.x + sibling.width && sibling.x < previousBox.x + previousBox.width;
1829
+ return isAhead && overlapsVertically && crossesHorizontally && !wasAlreadyOverlapping;
1829
1830
  });
1830
1831
  if (!collision) return;
1831
1832
  this.state.x = previous.x;