Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Jollywatt opened this issue Jun 1, 2024 · 1 comment
Closed
Labels

Comments

@Jollywatt
Copy link
Contributor

Jollywatt commented Jun 1, 2024

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
@Jollywatt Jollywatt changed the title Add a "no bounds" option for elements to so they don't affect layout Add a "no bounds" option for elements so they don't affect layout Jun 1, 2024
@johannes-wolf
Copy link
Member

Adding something like this is planned. I think float is a good name 👍.

Jollywatt added a commit to Jollywatt/cetz that referenced this issue Jun 1, 2024
Jollywatt added a commit to Jollywatt/cetz that referenced this issue Jun 1, 2024
Jollywatt added a commit to Jollywatt/cetz that referenced this issue Jun 2, 2024
johannes-wolf pushed a commit that referenced this issue Jun 2, 2024
* grouping: Add `draw.floating(body)` (#619)

* changes: mention `draw.floating`

* manual: add `draw.floating`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants