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

Add a "no bounds" option for elements so they don't affect layout #619

Closed Jollywatt closed 3 months ago

Jollywatt commented 4 months ago

As I understand, bounding boxes always reshape to the drawables they contain, without there being a way for certain drawables to opt-out.

It would be good to have a bounds: none option or a draw.no-bounds(body) wrapper that sets the drawable's bounds to none so it does not affect parent bounds. (A better name for this wrapper might be draw.place(body), or draw.float(body). It would complement draw.hide(body) in a sense.)

An example use case is something like in the image below, where it is desired that the canvas bounding box be at the red border, not affected by the long label (a draw.content node).

Screenshot 2024-06-01 at 15 07 48
johannes-wolf commented 4 months ago

Adding something like this is planned. I think float is a good name :+1:.