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:
1 parent
0cb2019704
commit
70c819393c
10 files changed
+268
-23
No files matched your search
@@ -249,6 +249,7 @@ typedef struct {
|
||||
#define rb_text_f tb_ed_w.text_f
|
||||
#define rb_icon tb_ed_w.icon
|
||||
#define rb_shadow tb_ed_w.shadow
|
||||
#define rb_ripple tb_ed_w.ripple
|
||||
|
||||
static const Col COL_MENU TB_EW_UNUSED = C( 76,151,255); /* #4C97FF */
|
||||
static const Col COL_MENU_DARK TB_EW_UNUSED = C( 61,121,204);
|
||||
|
||||
@@ -147,6 +147,7 @@ static inline void m3_state(TinyBlocks_RenderableBlock* rb, float x, float y, fl
|
||||
Col on, bool hover, bool pressed) {
|
||||
float a = pressed ? M3_PRESSED : hover ? M3_HOVER : 0.f;
|
||||
if (a > 0.f) rb_fill_rrect(rb, x, y, w, h, rad, m3_alpha(on, a));
|
||||
rb_ripple(rb, x, y, w, h, rad, on); /* gota do toque/clique */
|
||||
}
|
||||
|
||||
/* == Botoes (pilula): filled, tonal, outlined, text === */
|
||||
@@ -191,6 +192,7 @@ static inline void m3_icon_button(TinyBlocks_RenderableBlock* rb, float cx, floa
|
||||
float s = M3_ICON_BTN;
|
||||
if (selected) rb_fill_circle(rb, cx, cy, s * 0.5f, m3_alpha(c, 0.16f));
|
||||
if (hover) rb_fill_circle(rb, cx, cy, s * 0.5f, m3_alpha(c, M3_HOVER));
|
||||
rb_ripple(rb, cx - s * 0.5f, cy - s * 0.5f, s, s, s * 0.5f, c);
|
||||
rb_icon(rb, cx, cy, icon, M3_ICON, c, selected);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ typedef struct {
|
||||
void (*text_f) (TinyBlocks_RenderableBlock*, float, float, const char*, TbEwColor, float, int);
|
||||
void (*icon) (TinyBlocks_RenderableBlock*, float, float, unsigned, float, TbEwColor, bool);
|
||||
void (*shadow) (TinyBlocks_RenderableBlock*, float, float, float, float, float, int);
|
||||
void (*anim_now) (double);
|
||||
void (*ripple_down) (float, float);
|
||||
void (*ripple_up) (void);
|
||||
void (*ripple) (TinyBlocks_RenderableBlock*, float, float, float, float, float, TbEwColor);
|
||||
} TbEdWidgetsApi;
|
||||
|
||||
/* API da library privada tinyblocks-editor-image */
|
||||
|
||||
Reference in new issue
Block a user