-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: add new 'edgeLimit' option #429
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #429 +/- ##
==========================================
- Coverage 75.29% 74.60% -0.70%
==========================================
Files 8 8
Lines 1368 1382 +14
==========================================
+ Hits 1030 1031 +1
- Misses 338 351 +13
Continue to review full report at Codecov.
|
Good job, but still have some problems:
|
As of v.1.9.0, you can use the https://fengyuanchen.github.io/viewerjs/examples/moving-range-limit.html |
Brilliant Idea, Thanks a lot, maxOffsetPercentage do solve the first question as well, I'm just starting to rewrite and thinking the possibility to implement this feature on handler method like move and by then you've just done it. BTW, should moving range limitation to be the default behavior of the plugin? I can't think of a use case that will allow to move image off of screen? So the question is, do we need to implement as an options or in other way is to made it as default behavior? I'm willing to help for moving it to the options method if you don't mind. Anyway, You may close this PR anytime you like, thanks |
Minor bug detected, while zoomin around 300% and stick to edge of the screen, triggering toggle event (dbclick) may cause image out off canvas due to 100% centering issues, This issue might be solved if we could dispatch move event along with zoomTo event or other similar event that will cause marginTop to moving the picture, perhaps? |
Yes, the moving range limitation should be the default behavior but can be off if the user wants, so a new option defaults to |
In the given example, it will move the image into view if it is invisible after zoomed out now. |
fixed #352
added edgeLimit option to limit move event out of screen/container. default edgeRatio is 0.5 which based on moveable image.
Summary
What kind of change does this PR introduce? (check at least one)
If changing the UI of default theme, please provide the before/after screenshot:
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact and migration path for existing applications:
The PR fulfills these requirements:
fix #xxx[,#xxx]
, where "xxx" is the issue number)You have tested in the following browsers: (Providing a detailed version will be better.)
If adding a new feature, the PR's description includes:
To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.
Other information: