diff --git a/src/draw.typ b/src/draw.typ index 02fecfe..b2ea80f 100644 --- a/src/draw.typ +++ b/src/draw.typ @@ -29,13 +29,14 @@ } if node.label != none { + let ε = 1e-10pt // temp fix for https://github.com/Jollywatt/typst-fletcher/issues/64 cetz.draw.content( node.pos.xyz, box( // wrapping label in a box allows user to control its alignment align(center + horizon, node.label), stroke: if debug >= 3 { DEBUG_COLOR2 + 0.25pt }, - width: node.size.at(0) - 2*node.inset, + width: node.size.at(0) - 2*node.inset + ε, height: node.size.at(1) - 2*node.inset, ), anchor: "center", diff --git a/tests/issues/ref/1.png b/tests/issues/ref/1.png new file mode 100644 index 0000000..ec12eb6 Binary files /dev/null and b/tests/issues/ref/1.png differ diff --git a/tests/issues/test.typ b/tests/issues/test.typ new file mode 100644 index 0000000..a8359e0 --- /dev/null +++ b/tests/issues/test.typ @@ -0,0 +1,9 @@ +#set page(width: auto, height: auto, margin: 1em) +#import "/src/exports.typ" as fletcher: diagram, node, edge + +#show link: underline + +https://github.com/Jollywatt/typst-fletcher/issues/64 + +#diagram($A times B$) +#par(justify: true, diagram($A times B$))