idk some stuff

This commit is contained in:
Alessandro Mauri 2024-12-17 11:26:59 +01:00
parent c1a7b4fcdb
commit c0e9565bf6
12 changed files with 131 additions and 81 deletions

View file

@ -135,7 +135,8 @@ fn void! Ctx.push_string(&ctx, Rect bounds, String text)
.w = gp.w,
.h = gp.h,
};
if (rect_collision(gb, bounds)) {
// push the sprite only if it collides with the bounds
if (gb.collides(bounds)) {
ctx.push_sprite(gb, gt, texture_id)!;
}
line_len += gp.adv;
@ -173,4 +174,4 @@ fn void! Ctx.push_scissor(&ctx, Rect rect)
.scissor.rect = rect,
};
ctx.cmd_queue.enqueue(&sc)!;
}
}