Editor: ripple do M3, formas lisas e encaixes como no Scratch

- Ripple (gota que cresce do toque/clique) em todo componente com camada
  de estado; recortado no formato do componente (tb_ew_ripple).
- TB_DRAW_FILL_POLY: poligono convexo com antialias (pontos no espaco do
  text). Hexagono e encaixe deixam de ser faixas de 1 px (sumiam em linhas
  com zoom e na densidade do celular).
- Encaixe macho com cantos arredondados; encaixe femea recortado no topo
  dos comandos e dos blocos C (e nos bracos de baixo/"senao").
- Destaque ao soltar um reporter num campo segue a forma do campo; sombra
  de encaixe da pilha com a forma de bloco.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mguinhosandClaude Opus 5.5 committed 2026-10-28 22:23:32 -03:00
1 parent 0cb2019704
commit 70c819393c
10 files changed
+268 -23

No files matched your search

@@ -127,9 +127,13 @@ static bool resolve_widgets(void) {
sym_fn(&w.text_f, "tinyblocks-editor-widgets", "tb_ew_text_f");
sym_fn(&w.icon, "tinyblocks-editor-widgets", "tb_ew_icon");
sym_fn(&w.shadow, "tinyblocks-editor-widgets", "tb_ew_shadow");
sym_fn(&w.anim_now, "tinyblocks-editor-widgets", "tb_ew_anim_now");
sym_fn(&w.ripple_down, "tinyblocks-editor-widgets", "tb_ew_ripple_down");
sym_fn(&w.ripple_up, "tinyblocks-editor-widgets", "tb_ew_ripple_up");
sym_fn(&w.ripple, "tinyblocks-editor-widgets", "tb_ew_ripple");
bool ok = w.col_mul && w.fill_rect && w.fill_rrect && w.fill_circle && w.stroke_rect &&
w.stroke_circle && w.line && w.text_c && w.text_width && w.in_rect &&
w.text_f && w.icon && w.shadow;
w.text_f && w.icon && w.shadow && w.anim_now && w.ripple_down && w.ripple_up && w.ripple;
if (ok) tb_ed_w = w;
return ok;
}
@@ -179,7 +183,9 @@ bool tb_ed_modules_load(Ed* ed) {
.fill_circle = tb_ew_fill_circle, .stroke_rect = tb_ew_stroke_rect,
.stroke_circle = tb_ew_stroke_circle, .line = tb_ew_line, .text_c = tb_ew_text_c,
.text_width = tb_ew_text_width, .in_rect = tb_ew_in_rect,
.text_f = tb_ew_text_f, .icon = tb_ew_icon, .shadow = tb_ew_shadow };
.text_f = tb_ew_text_f, .icon = tb_ew_icon, .shadow = tb_ew_shadow,
.anim_now = tb_ew_anim_now, .ripple_down = tb_ew_ripple_down, .ripple_up = tb_ew_ripple_up,
.ripple = tb_ew_ripple };
tb_ed_img = (TbEdImageApi){
.view = tb_editor_image_view, .click = tb_editor_image_click, .drag = tb_editor_image_drag,
.release = tb_editor_image_release, .load_file = tb_editor_image_load_file,