texture_sampler: remap px, py

This commit is contained in:
Zack Buhman 2025-04-08 20:30:53 -05:00
parent e21f0883bd
commit a3852c1a2c

View File

@ -40,7 +40,7 @@ def sample(im, l):
#x = 1 - x
y = 1 - y
px, py = int(x * width), int(y * height)
px, py = remap(x, 0, 1, 0, width - 1), remap(y, 0, 1, 0, height - 1)
assert px < width and py < height
color = im.getpixel((px, py))