The code actually handles this case correctly; the algorithm is linear interpolation between the two closest samples, and the way it is written should work correctly with any ratio.
The code actually handles this case correctly; the algorithm is linear interpolation between the two closest samples, and the way it is written should work correctly with any ratio.