1
0
forked from HEL/circuiteria

adapted extender + improved bound anchors

This commit is contained in:
2025-04-19 16:49:46 +02:00
parent 33d79f35fa
commit 4733f69b51
6 changed files with 61 additions and 96 deletions

View File

@ -209,6 +209,15 @@
)
func
draw.anchor("north", bounds.t)
draw.anchor("south", bounds.b)
draw.anchor("west", bounds.l)
draw.anchor("east", bounds.r)
draw.anchor("north-west", bounds.tl)
draw.anchor("north-east", bounds.tr)
draw.anchor("south-east", bounds.br)
draw.anchor("south-west", bounds.bl)
if elmt.name != none {
draw.content(
(name: elmt.id, anchor: elmt.name-anchor),
@ -219,6 +228,14 @@
}
add-ports(elmt, bounds)
if elmt.debug.bounds {
draw.line(
bounds.tl, bounds.tr, bounds.br, bounds.bl,
stroke: red,
close: true
)
}
})
/// Draws an element
@ -263,6 +280,7 @@
id: auto,
ports-pos: auto,
debug: (
bounds: false,
ports: false
),
extra: (:)
@ -287,7 +305,6 @@
ports.at(key) = side-ports
}
return ((
cls: cls,
id: id,