added name anchor to ALU
This commit is contained in:
parent
08f931bbde
commit
699b3c0189
@ -24,6 +24,7 @@
|
|||||||
draw.anchor("south", (p2, 50%, p3))
|
draw.anchor("south", (p2, 50%, p3))
|
||||||
draw.anchor("west", (p0, 50%, p3))
|
draw.anchor("west", (p0, 50%, p3))
|
||||||
draw.anchor("east", (p1, 50%, p2))
|
draw.anchor("east", (p1, 50%, p2))
|
||||||
|
draw.anchor("name", (p5, 50%, (p1, 50%, p2)))
|
||||||
})
|
})
|
||||||
|
|
||||||
let f2 = add-port(id, "west", (id: "in1"), (p0, 50%, p6))
|
let f2 = add-port(id, "west", (id: "in1"), (p0, 50%, p6))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#import "@preview/cetz:0.2.2": draw, coordinate
|
#import "@preview/cetz:0.2.2": draw, coordinate
|
||||||
#import "ports.typ": add-ports, add-port
|
#import "ports.typ": add-ports, add-port
|
||||||
|
#import "../util.typ"
|
||||||
|
|
||||||
#let find-port(ports, id) = {
|
#let find-port(ports, id) = {
|
||||||
for (side, side-ports) in ports {
|
for (side, side-ports) in ports {
|
||||||
@ -115,7 +116,7 @@
|
|||||||
if (name != none) {
|
if (name != none) {
|
||||||
draw.content(
|
draw.content(
|
||||||
(name: id, anchor: name-anchor),
|
(name: id, anchor: name-anchor),
|
||||||
anchor: name-anchor,
|
anchor: if name-anchor in util.valid-anchors {name-anchor} else {"center"},
|
||||||
padding: 0.5em,
|
padding: 0.5em,
|
||||||
align(center)[*#name*]
|
align(center)[*#name*]
|
||||||
)
|
)
|
||||||
|
@ -68,4 +68,9 @@
|
|||||||
south-east: "south-west",
|
south-east: "south-west",
|
||||||
south-west: "north-west"
|
south-west: "north-west"
|
||||||
).at(anchor)
|
).at(anchor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#let valid-anchors = (
|
||||||
|
"center", "north", "east", "west", "south",
|
||||||
|
"north-east", "north-west", "south-east", "south-west"
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user