|
|
@ -89,23 +89,20 @@ fn void! Ctx.text_unbounded(&ctx, String label, String text) |
|
|
|
Codepoint cp = (Codepoint)c; |
|
|
|
Codepoint cp = (Codepoint)c; |
|
|
|
if (cp != '\n') { |
|
|
|
if (cp != '\n') { |
|
|
|
gp = ctx.font.get_glyph(cp)!; |
|
|
|
gp = ctx.font.get_glyph(cp)!; |
|
|
|
Cmd cmd = { |
|
|
|
Rect gb = { |
|
|
|
.type = CMD_SPRITE, |
|
|
|
|
|
|
|
.sprite.rect = { |
|
|
|
|
|
|
|
.x = orig.x + line_len + gp.ox, |
|
|
|
.x = orig.x + line_len + gp.ox, |
|
|
|
.y = orig.y + gp.oy + baseline, |
|
|
|
.y = orig.y + gp.oy + baseline, |
|
|
|
.w = gp.w, |
|
|
|
.w = gp.w, |
|
|
|
.h = gp.h, |
|
|
|
.h = gp.h, |
|
|
|
}, |
|
|
|
}; |
|
|
|
.sprite.texture_rect = { |
|
|
|
Rect gt = { |
|
|
|
.x = gp.u, |
|
|
|
.x = gp.u, |
|
|
|
.y = gp.v, |
|
|
|
.y = gp.v, |
|
|
|
.w = gp.w, |
|
|
|
.w = gp.w, |
|
|
|
.h = gp.h, |
|
|
|
.h = gp.h, |
|
|
|
}, |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
ctx.push_sprite(gb, gt)!; |
|
|
|
line_len += gp.adv; |
|
|
|
line_len += gp.adv; |
|
|
|
ctx.cmd_queue.enqueue(&cmd)!; |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
orig.y += line_height + line_gap; |
|
|
|
orig.y += line_height + line_gap; |
|
|
|
line_len = 0; |
|
|
|
line_len = 0; |
|
|
|