Add radius parameter to block #12

Merged
HEL merged 3 commits from Shmerlard/circuiteria:main into dev 2025-08-17 12:36:04 +00:00
2 changed files with 6 additions and 6 deletions

View File

@@ -9,6 +9,5 @@
/// - length (length, ratio): Optional base unit /// - length (length, ratio): Optional base unit
/// -> none /// -> none
#let circuit(body, length: 2em) = { #let circuit(body, length: 2em) = {
set text(font: "Source Sans 3")
canvas(length: length, body) canvas(length: length, body)
Outdated
Review

Would be better not to set the font at all

Would be better not to set the font at all
} }

View File

@@ -1,9 +1,9 @@
#import "@preview/cetz:0.3.2": draw #import "@preview/cetz:0.3.2": draw
#import "element.typ" #import "element.typ"
#let draw-shape(id, tl, tr, br, bl, fill, stroke) = { #let draw-shape(id, tl, tr, br, bl, fill, stroke, radius: 0.5em) = {
let f = draw.rect( let f = draw.rect(
radius: 0.5em, radius: radius,
inset: 0.5em, inset: 0.5em,
fill: fill, fill: fill,
stroke: stroke, stroke: stroke,
@@ -27,13 +27,14 @@
ports: (), ports: (),
ports-margins: (), ports-margins: (),
fill: none, fill: none,
radius: 0.5em,
stroke: black + 1pt, stroke: black + 1pt,
id: "", id: "",
debug: ( debug: (
ports: false ports: false
) )
) = element.elmt( ) = element.elmt(
draw-shape: draw-shape, draw-shape: draw-shape.with(radius: radius),
x: x, x: x,
y: y, y: y,
w: w, w: w,