Converte símbolos Unicode decorativos dos comentários para ASCII
Substitui barras de caixa (─ ═ │ ┌ ┐ └ ┘ ├ ┤ ┬ ┴), travessões (—), setas (→ ←), reticências (…), bullets (•), multiplicação (×) e guillemets (› ‹) por equivalentes ASCII. Acentos portugueses são preservados.
This commit is contained in:
1 parent
1cc0ff9d02
commit
90d47bf8a0
36 files changed
+327
-327
No files matched your search
+20
-20
@@ -1,16 +1,16 @@
|
||||
/*
|
||||
* vector.c — Library de vetor 2D para o TinyBlocks Editor.
|
||||
* vector.c - Library de vetor 2D para o TinyBlocks Editor.
|
||||
*
|
||||
* Blocos incluídos:
|
||||
* Vector.BeginPath — inicia um novo path (sem inputs)
|
||||
* Vector.MoveTo — move caneta para (x, y)
|
||||
* Vector.LineTo — linha até (x, y)
|
||||
* Vector.ClosePath — fecha sub-path atual
|
||||
* Vector.Stroke — aplica traçado com cor/espessura RGBA
|
||||
* Vector.Fill — aplica preenchimento RGBA ao path
|
||||
* Vector.Rect — retângulo preenchido (usa Fill por cima)
|
||||
* Vector.Circle — círculo preenchido
|
||||
* Vector.Render — recebe vector e desenha no corpo do bloco (on_draw)
|
||||
* Vector.BeginPath - inicia um novo path (sem inputs)
|
||||
* Vector.MoveTo - move caneta para (x, y)
|
||||
* Vector.LineTo - linha até (x, y)
|
||||
* Vector.ClosePath - fecha sub-path atual
|
||||
* Vector.Stroke - aplica traçado com cor/espessura RGBA
|
||||
* Vector.Fill - aplica preenchimento RGBA ao path
|
||||
* Vector.Rect - retângulo preenchido (usa Fill por cima)
|
||||
* Vector.Circle - círculo preenchido
|
||||
* Vector.Render - recebe vector e desenha no corpo do bloco (on_draw)
|
||||
*
|
||||
* Todos os blocos encadeiam: cada um recebe o vetor do anterior e devolve
|
||||
* um novo com o comando acrescentado. Combine-os com Vector.Render no final.
|
||||
@@ -19,7 +19,7 @@
|
||||
* make vector
|
||||
*
|
||||
* Para carregar no editor:
|
||||
* Ctrl+O → build/vector.so ou arraste build/vector.so para a janela
|
||||
* Ctrl+O -> build/vector.so ou arraste build/vector.so para a janela
|
||||
*/
|
||||
|
||||
#define _POSIX_C_SOURCE 200809L
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <tinyblocks/tinyblocks.h>
|
||||
#include <tinyblocks/tb_renderable_block.h>
|
||||
|
||||
/* ── Helper: lê float de qualquer slot numérico ──────────────────────────── */
|
||||
/* -- Helper: lê float de qualquer slot numérico --- */
|
||||
static float gf(TinyBlocks_Block* self, TinyBlocks* rt, uint32_t idx) {
|
||||
TinyBlocks_Value v = tb_block_get_input(self, rt, idx);
|
||||
if (v.kind == TB_VALUE_REAL) return (float)v.as.real;
|
||||
@@ -51,9 +51,9 @@ static TinyBlocks_VectorData* clone_vec(TinyBlocks_Block* self, TinyBlocks* rt)
|
||||
(self)->dirty = false; \
|
||||
} while(0)
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Implementações dos blocos
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
|
||||
static void eval_begin_path(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
(void)rt;
|
||||
@@ -115,7 +115,7 @@ static void eval_circle(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
EMIT_VEC(self, v);
|
||||
}
|
||||
|
||||
/* Vector.Render — passa o vetor adiante e tem on_render para preview */
|
||||
/* Vector.Render - passa o vetor adiante e tem on_render para preview */
|
||||
static void eval_render(TinyBlocks_Block* self, TinyBlocks* rt) {
|
||||
TinyBlocks_Value v = tb_block_get_input(self, rt, 0);
|
||||
/* Clona para manter o vector vivo no output (get_input é não-owning) */
|
||||
@@ -138,9 +138,9 @@ static bool on_draw_vector(TinyBlocks_Block* self, TinyBlocks* rt,
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Descritores de slots
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static const TinyBlocks_SlotDesc out_vec[] = {{"vec", TB_VALUE_VECTOR}};
|
||||
static const TinyBlocks_SlotDesc in_vec[] = {{"vec", TB_VALUE_VECTOR}};
|
||||
static const TinyBlocks_SlotDesc in_vec_xy[] = {{"vec", TB_VALUE_VECTOR},
|
||||
@@ -167,9 +167,9 @@ static const TinyBlocks_SlotDesc in_vec_cyr[] = {{"vec", TB_VALUE_VECTOR},
|
||||
{"cy", TB_VALUE_REAL},
|
||||
{"r", TB_VALUE_REAL}};
|
||||
|
||||
/* ══════════════════════════════════════════════════════════════════════════
|
||||
/* ===
|
||||
* Registro da library
|
||||
* ══════════════════════════════════════════════════════════════════════════ */
|
||||
* === */
|
||||
static bool vector_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
TinyBlocks_TypeBlock* t;
|
||||
|
||||
@@ -188,7 +188,7 @@ static bool vector_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) {
|
||||
|
||||
#undef REG
|
||||
|
||||
/* Vector.Render tem on_draw — preview gráfico no corpo do bloco */
|
||||
/* Vector.Render tem on_draw - preview gráfico no corpo do bloco */
|
||||
t = tb_type_block_create(rt, "Vector.Render",
|
||||
in_vec, 1, out_vec, 1, eval_render);
|
||||
if (t) {
|
||||
|
||||
Reference in new issue
Block a user