-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improve Zoom function (at least fo my use) #1
Conversation
# Conflicts: # index.d.ts
# Conflicts: # index.d.ts
Oh, I also fetched to v3.9.0 and added bundle js and css files |
@Amerlander I merged your commit. |
This is an issue that I didn't have time to work on. @Amerlander . But you're right for my use case I didn't want the zoom to be less than 1 but it can be changed. I am not using the UI this library provides but I am just using the APIs for a custom UI of my own where zoom can't be less than 1. If you think its a good idea to implement it to the current zoom feature go ahead and test it out and let me know if any issues. I can merge it and create a release. |
Hej,
at first I want to thank you for your fork and addition of the zoom functionality.
I added two things for my use. Maybe it helps someone else too:
The Zoom gets back to 1 right before a cropping is applied. In my case the image got wrong resolution if the zoom was set to some else value.
I enabled the zoom to be less than 1. Was there any reason for not doing this?
My setup is as following:
cssMaxWidth
andcssMaxHeight
is set to a never reached value like 100.000The Zoom is done by a input, a 1:1 and a 100% button (html uses fomantic ui):
The function
setInitialZoom()
is also called after tui is initialized and sets the zoom to fit the window and scrolls to the center:If this makes sense, then it might be an idea to merge this into the zoom function itself. I haven't done this, because its referencing dom objects which aren't created by tui.
Maybe this PR doesn't make that much sense to you at all, but I just thought I'll share my implementation.