Fix mirror sampling in trunk. Fixes issue 135.
This commit is contained in:
parent
e8dc679874
commit
2c969b70a5
@ -21,10 +21,13 @@ namespace
|
||||
{
|
||||
static int mirror(int x, int w)
|
||||
{
|
||||
if (w == 1) return 0;
|
||||
|
||||
x = abs(x);
|
||||
while (x >= w) {
|
||||
x = 2 * w - x - 2;
|
||||
x = abs(w + w - x - 2);
|
||||
}
|
||||
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user