faiface / pixel

A hand-crafted 2D game library in Go
MIT License
4.46k stars 246 forks source link

Fixing line intersection for lines through origin #236

Closed bcvery1 closed 4 years ago

bcvery1 commented 4 years ago

Resolves #210

Description

The issue was that the algorithm which gets the closest corner of a Rect to a point on the line did not account for that point being ZV, so always ignored it. The algorithm now uses a pointer to ensure every closest vector is valid.

Changes

delp commented 4 years ago

Awesome, thanks for the quick turn around on this.