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

Underflow box #86

Closed
edemaine opened this issue Aug 24, 2022 · 0 comments
Closed

Underflow box #86

edemaine opened this issue Aug 24, 2022 · 0 comments

Comments

@edemaine
Copy link
Owner

edemaine commented Aug 24, 2022

Imagine a 2x2 tile that consists of just a vertical line through the center. When this tile (and only such tiles) appears on the right boundary of the drawing, we might want to set the width of the drawing to end just after the vertical line, treating the tile as width ~1, instead of the full width of 2. And similarly when on the left side, we'd like the left border to start later if the space to the left of the line isn't needed.

A natural mechanism for this would be viewBox="-1 -1 2 2" overflowBox="-0.1 -1 0.2 2" (for a vertical line of width 0.2). In other words, the overflowBox is smaller than the viewBox, and used to compute the drawing's bounding box when specified. I doubt anyone currently uses overflowBox smaller than viewBox, so this is a natural extension. The downside of using overflowBox is that the name isn't right; it'd be more aptly named boundingBox. Probably we should rename but view overflowBox as an alias for backward compatibility.

I also realize that overflowBox currently ignores the first two numbers; it really only needs width and height. It could request just two numbers (but for backward compatibility, ignore the first two if four are specified). But the new boundingBox actually needs the first two numbers to know what exactly to crop when it's unneeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant