Skip to content

Commit

Permalink
fix: deleting intersection in loop (reversing the loop obv)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Oct 17, 2024
1 parent 406cd2c commit ad96f7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/pointer-events/src/intersections/ray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class RayIntersector extends Intersector {
if (this.options.minDistance != null) {
const length = intersectsHelper.length
const localMinDistance = this.options.minDistance / this.worldScale
for (let i = 0; i < length; i++) {
for (let i = length - 1; i >= 0; i--) {
if (intersectsHelper[i].distance < localMinDistance) {
intersectsHelper.splice(i, 1)
}
Expand Down

0 comments on commit ad96f7b

Please sign in to comment.