summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--texture.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/texture.c b/texture.c
index b30f829..5d04b89 100644
--- a/texture.c
+++ b/texture.c
@@ -24,7 +24,8 @@ enum {
static Point
uv2tp(Point2 uv, Texture *t)
{
- assert(uv.x >= 0 && uv.x <= 1 && uv.y >= 0 && uv.y <= 1);
+ uv.x = fclamp(uv.x, 0, 1);
+ uv.y = fclamp(uv.y, 0, 1);
return Pt(uv.x*Dx(t->image->r), (1 - uv.y)*Dy(t->image->r));
}