Skip to content

Width and Height from Group #55

Answered by cduck
1081 asked this question in Q&A
Jul 10, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Not with drawSvg. drawSvg does not understand the sizes of shapes, it only allows you to put them together into an SVG.

It sounds like if you add shapes to the group positioned so (0, 0) is the center, you may not need to calculate the bounding box (width and height). In general it is better to manually calculate the intended size so you aren't surprised by things like an over-full text field unexpectedly changing the final position.

If you do really want to find the bounding box, CairoSVG may be able approximate it. See #25 for a discussion and code related to this.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@1081
Comment options

@lythhh
Comment options

Answer selected by cduck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #54 on July 11, 2021 03:59.