
With the previous implementation, we could have pixels with offset larger than 1 pixel. Also fix a bug when the closest_index is not last. The sample positions were incorrect in this case.
With the previous implementation, we could have pixels with offset larger than 1 pixel. Also fix a bug when the closest_index is not last. The sample positions were incorrect in this case.