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

Proper scaling #2

Open
ShadowLp174 opened this issue Nov 14, 2022 · 1 comment
Open

Proper scaling #2

ShadowLp174 opened this issue Nov 14, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@ShadowLp174
Copy link
Contributor

ShadowLp174 commented Nov 14, 2022

Scaling is broken af as there are no specfic points to scale the points around.

A possible approach is to calculate the center of every shape and move and scale all children accordingly to this.

This would be incredibly complicated though and might result in lag.

Another approach is the css transform: scale(1.2) rule, which effects have to be explored though

Interesting approach: using the viewbox attribute to set the aspect ratio of the image and enable scaling. Usage in combination with preserveAspectRatio="xMinYMin meet" or maybe better: preserveAspectRatio="xMinYMin slice". Downside: scaling also scales the available space for the engine

https://css-tricks.com/scale-svg/

image

image

image

@ShadowLp174 ShadowLp174 added the enhancement New feature or request label Nov 14, 2022
@ShadowLp174 ShadowLp174 self-assigned this Nov 14, 2022
@ShadowLp174 ShadowLp174 moved this to 🏗 In progress in OpenVS Graphics Nov 14, 2022
@ShadowLp174
Copy link
Contributor Author

Research has revealed that scaling using viewBox and preserveAspectRatio works the best and the easiest. The calculating approach might be implemented for easy components later

@ShadowLp174 ShadowLp174 added this to the Scaling milestone Nov 15, 2022
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
Status: 🏗 In progress
Development

No branches or pull requests

1 participant