cetz-package / cetz

CeTZ: ein Typst Zeichenpaket - A library for drawing stuff with Typst.
https://cetz-package.github.io
GNU Lesser General Public License v3.0
846 stars 35 forks source link

Provide a node for the canvas' current bounding box #616

Open kram-tm opened 4 months ago

kram-tm commented 4 months ago

I propose adding a node to represent the current bounding box of the canvas with the usual anchors of rect (south-{east,west}, north-{east,west}, east, west, north, south). This node is called current bounding box in TikZ and would allow the placement of shapes relative to the anchors of the box without needing to infer the bounds manually or, as suggested as a temporary workaround by Johannes Wolf, embedding the relevant elements into a group (which may presumably entail nesting of groups for multiple redefinitions of the bounds — an issue avoided by having a node that's updated repeatedly).

johannes-wolf commented 4 months ago

Note: such a node should not represent the current bbox of the canvas but the current bbox of the scope (canvas at root scope).