fix: Y origin in prepare_chipmunk_shader

Convert surface_area from top-left pixels to bottom-left UVs so `bot_left`/`top_right` align with `tex_coord` and the clip box is correct.
This commit is contained in:
BromBrom
2025-08-28 22:32:53 +02:00
parent 59a66a8a5a
commit eda8ad35f3
+3 -2
View File
@@ -109,8 +109,9 @@ static void prepare_chipmunk_shader(struct gfx_render_job *job, void *data)
r = (Rectangle) { 0, 0, sp->rect.w, sp->rect.h };
}
glUniform2f(s->bot_left, r.x, r.y);
glUniform2f(s->top_right, r.x + r.w, r.y + r.h);
int sy_bottom = sp->rect.h - (r.y + r.h);
glUniform2f(s->bot_left, r.x, sy_bottom);
glUniform2f(s->top_right, r.x + r.w, sy_bottom + r.h);
}
void sprite_init_sact(void)