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

Handle PointSize in PointBox (roughly) #1407

Merged
merged 2 commits into from
Jun 5, 2021
Merged

Conversation

rocky
Copy link
Member

@rocky rocky commented Jun 5, 2021

Originally I had this as a hack on svg formatting. Then I saw that asymptote formatting was broken too.

The basic problem is that PointBox doesn't handle PointSize as 0-width points. But the formatters, naturally fill in a nonzero point width. This causes points to extend outside of the viewport for SVG.

PointSize is specified as a fraction of the image width and we might not always have that. And for PointBox we don't have access to the top-level graphics options.

A lot of this should be (re)thought out or documented if it already is.

Either way once you start to disentangle the code, a lot of the weaknesses become apparent.

Fixes #1091

This should really be fixed in the the routine _prepare_elements and
calc_dimensions, but this entagles us too much.

Also this causes axes to extend below 0, but this is a more minor
effect, I think.
@rocky rocky requested a review from mmatera June 5, 2021 02:08
@rocky rocky force-pushed the svg-formatter-size-adjust branch from 483be17 to 4840b18 Compare June 5, 2021 02:12
Numerous other small adjustments were made too.
@rocky rocky force-pushed the svg-formatter-size-adjust branch from 4840b18 to 029d06a Compare June 5, 2021 02:38
@rocky rocky merged commit f0abdef into master Jun 5, 2021
@rocky rocky deleted the svg-formatter-size-adjust branch June 6, 2021 20:57
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

Successfully merging this pull request may close these issues.

SVG rendering clips points at the boundaries.
1 participant