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

viewBox for svg #347

Closed
typemytype opened this issue Dec 19, 2019 · 6 comments · Fixed by #348
Closed

viewBox for svg #347

typemytype opened this issue Dec 19, 2019 · 6 comments · Fixed by #348

Comments

@typemytype
Copy link
Owner

@typemytype typemytype commented Dec 19, 2019

see https://forum.drawbot.com/topic/225/svg-attributes-viewbox

proposal: ˋsaveImage(svgPath, viewBox=(x, y, w, h))ˋ

as and extra arg while saving a svg, the viewBox can be different from the width and height of the document.

@justvanrossum

This comment has been minimized.

Copy link
Collaborator

@justvanrossum justvanrossum commented Dec 20, 2019

What is the use case for the viewBox not being the same as (width, height)? That doesn't follow for me from the forum post.

@typemytype

This comment has been minimized.

Copy link
Owner Author

@typemytype typemytype commented Dec 20, 2019

Googled a nice write up: https://www.sarasoueidan.com/blog/svg-coordinate-systems/

Maybe the fallback/default should keep the same dimensions as width height

@justvanrossum

This comment has been minimized.

Copy link
Collaborator

@justvanrossum justvanrossum commented Dec 20, 2019

My question is not how/why it can be different, but why in DrawBot would you want them to be different. I see no such question in the forum post, only that a missing viewBox is a problem.

So I suggest to add viewBox="0 0 <width> <height>", and I think that would solve the problem perfectly.

@typemytype

This comment has been minimized.

Copy link
Owner Author

@typemytype typemytype commented Dec 20, 2019

the question on the forum is idd a request to add a viewBox

I guess its handy to have a setting for svg: as this is very similar to dpi for images

@justvanrossum

This comment has been minimized.

Copy link
Collaborator

@justvanrossum justvanrossum commented Dec 20, 2019

Please keep things simple, and don't add features we're not quite sure are actually needed.

@typemytype

This comment has been minimized.

Copy link
Owner Author

@typemytype typemytype commented Dec 20, 2019

oke makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.