Adiciona tipo imagem (core) + tinyblocks-ppm e previa de imagem no balao

This commit is contained in:
mguinhos committed 2026-10-20 21:04:41 -03:00
1 parent f794d8b8c7
commit 959a4027c3
16 files changed
+721 -10

No files matched your search

+13
View File
@@ -125,6 +125,16 @@ void tb_draw_text(TinyBlocks_RenderableBlock* rb,
strncpy(c->text, text, sizeof(c->text) - 1);
}
void tb_draw_image(TinyBlocks_RenderableBlock* rb,
float x, float y, float w, float h,
const TinyBlocks_Image* image) {
if (!image) return;
TinyBlocks_DrawCmd* c = append(rb); if (!c) return;
c->kind = TB_DRAW_IMAGE;
c->x = x; c->y = y; c->w = w; c->h = h;
c->image = image;
}
void tb_draw_merge_offset(TinyBlocks_RenderableBlock* dst,
const TinyBlocks_RenderableBlock* src,
float dx, float dy) {
@@ -143,6 +153,9 @@ void tb_draw_merge_offset(TinyBlocks_RenderableBlock* dst,
case TB_DRAW_STROKE_CIRCLE:
cmd.x += dx; cmd.y += dy;
break;
case TB_DRAW_IMAGE:
cmd.x += dx; cmd.y += dy;
break;
case TB_DRAW_STROKE_LINE:
cmd.x += dx; cmd.y += dy;
cmd.w += dx; cmd.h += dy;