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

Maintain stroke width upon zoom using the 'zui.js' extras pack or something else #546

Open
1 task done
Pranav-Badrinathan opened this issue Jul 6, 2021 · 2 comments
Open
1 task done
Assignees
Milestone

Comments

@Pranav-Badrinathan
Copy link

Pranav-Badrinathan commented Jul 6, 2021

Using the zui.zoomBy() function leads to a scaled version of the image where it's corner stroke is also scaled. Is there any way to mitigate this in the zui itself? If no, could someone point me in the right direction as to where to go from here?

My pan and zoom code is from Jono Brandel at Codepen.

Far:
image
Zoomed:
image

  • Code executes in browser, using ES6 imports.

If applicable:

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: chrome
  • Version 91.0.4472.124
@jonobr1
Copy link
Owner

jonobr1 commented Jul 7, 2021

Thanks for your question @Pranav-Badrinathan. Unfortunately, there isn't anything currently implemented in Two.js or the ZUI module to handle strokes in this way. But, if we were to handle it I think we'd need to add a boolean to every Path and Group to be able to assign linewidth as an absolute number in screen space or in the coordinate space relative to its matrix. The latter being how it's currently handled. I'll add this as an enhancement.

@jonobr1 jonobr1 modified the milestones: v0.7.5, v0.8.0 Jul 7, 2021
@jonobr1 jonobr1 self-assigned this Jul 7, 2021
@Pranav-Badrinathan
Copy link
Author

Ah I see. That's ok, and thanks for considering this as an enhancement. Maybe as a workaround, till when this enhancement might be made, I can scale all my elements to 'zoom' instead of zooming in... Or I'll just wait 😊. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants