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

Reset Viewbox #60

Open
justingolden21 opened this issue Feb 14, 2022 · 4 comments
Open

Reset Viewbox #60

justingolden21 opened this issue Feb 14, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@justingolden21
Copy link

The reset viewbox functionality (as seen in download and reset zoom) doesn't work for my path:

m13 0c2 0 11 4 11 20 3 0 4-2 2-8 4 2 10 12 4 20 0 1 2 2 3 0 0 28-40 18-32-6 4-12 14-8 12-26z

image

image

Absolutely love this tool by the way 😄

@Yqnn Yqnn added the enhancement New feature or request label Feb 19, 2022
@Yqnn
Copy link
Owner

Yqnn commented Feb 19, 2022

Indeed, the default boundary is currently computed using only start and end points.
This issue can occur with curves, quadratic curves and elliptical arcs.

Fixing it is a bit tricky, and requires some complicated maths 😅 .

@justingolden21
Copy link
Author

Can you run getBBox()

https://stackoverflow.com/a/40316084/4907950

@Yqnn
Copy link
Owner

Yqnn commented Feb 25, 2022

A bit of a hack, but indeed it should work.
I will give a try.

@justingolden21
Copy link
Author

Another idea: A button to quickly move it so the topmost and leftmost position is at 0,0. Currently, I would just go to export it, note the x and y values, and then translate the x and y negative that much so the export is at a viewbox of x and y at 0,0 and the width and height.

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

No branches or pull requests

2 participants