Fix: Wrong border nearest interpolation around negative edges
The BLI wrapmode variant of nearest interpolation for border boundary is wrong for coordinates between [-1, 0]. That's because the negative comparison in wrap_coord is done on the integer rounded coordinates, which will be zero in this case, so the condition will not fail. To fix this, do the comparison on the original coordinates instead. Pull Request: https://projects.blender.org/blender/blender/pulls/131306
This commit is contained in:
@@ -32,7 +32,7 @@ BLI_INLINE int wrap_coord(float u, int size, InterpWrapMode wrap)
|
||||
break;
|
||||
case InterpWrapMode::Border:
|
||||
x = int(u);
|
||||
if (x < 0 || x >= size) {
|
||||
if (u < 0.0f || x >= size) {
|
||||
x = -1;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user