Closed samuzora closed 1 year ago
I don't see why not although this could be easily resolved by wrapping the content in a box with padding...
I think this is useful to have. But should we make the default padding configurable? A default padding could be a bit unexpected. Tikz has none, I think.
I don't see why not although this could be easily resolved by wrapping the content in a box with padding...
True, it's just a shorthand for a common use case :)
I think this is useful to have. But should we make the default padding configurable? A default padding could be a bit unexpected. Tikz has none, I think.
Oh sure, I can see why it might break some stuff.
I could move it to ctx, and set via padding(length: 0em)
.
@samuzora Sounds good to me! I wrote a comment on PR for one small change. :-)
Merged.
Hi! Given that the more common use case for content blocks is labelling, a default padding for content blocks would make sense, so as to prevent the content block from overlapping the shape itself (example previews below)
In the default position
content("arc.right", [$l$], anchor: "left")
, the $l$ is too close to the arc.Here, I adjusted it with
content((rel: (0.5em, 0), to: "arc.right"), [$l$], anchor: "left")
and it looks great.A padding would make the anchors of the label a sufficient distance away from the text itself.
I think a syntax like
content(..., padding: <boolean or length>)
would make sense, with the default padding being 0.5em.If it sounds fine, I'm open to making a PR to add it.
Thanks! 😄