-
Notifications
You must be signed in to change notification settings - Fork 449
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
render: no js fit to screen alternative #725
render: no js fit to screen alternative #725
Conversation
hold off on this, will need to look into it more later |
@gavin-ts is the alternative method here nesting an svg under an svg? |
could you clarify? are you asking how it works? |
Yes! |
oh okay so it is basically the same svg with width and height set, but viewed through the outer svg with preserveAspectRatio set to place it in the top left corner and scale it based on the outer svg's size which is just the whole window when you open it. The preserveAspectRatio attribute handles the scaling and with width/height unset on the outer svg it is based on the dimensions you open it at. |
91588dc
to
4c0ca26
Compare
5f316fe
to
c12e361
Compare
@alixander rebased, updated adding the appendix and updated watch mode |
@alixander It looks like this actually fixes rendering when scaled in Firefox! Originalthere are clearly visible rendering issues near borders of the SVG Afterthey are no more thank you @gavin-ts! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow this works so well. well done, good riddance to a js resize script
Summary
An alternative method to fit to screen without js.
Details
wide diagram before .svg
Note: you likely need to download the file (save as) for the js resizing to run.
Note the height overflows
wide diagram after .svg
No download needed since resizing isn't via js.
small diagram before .svg
small diagram after .svg
tall diagram before .svg
tall diagram after .svg
disabling fit can be done by setting width/height on the outer svg
Related: #721 if we add the option to enable/disable fitting
Kapture.2023-01-26.at.14.43.19.mp4
fixes #645