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
fix: The image in the preview page can be zoomed through the panel an… #1890
Conversation
…d mouse; The initial size of the image preview is controlled by the image itself and the preview page; Remove unnecessary code
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit db6b9d6:
|
Passing run #2115 ↗︎
Details:
Review all test suite changes for PR #1890 ↗︎ |
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1890 +/- ##
==========================================
+ Coverage 88.05% 88.18% +0.12%
==========================================
Files 436 436
Lines 25501 25588 +87
Branches 6440 6469 +29
==========================================
+ Hits 22455 22564 +109
+ Misses 3046 3024 -22 ☔ View full report in Codecov by Sentry. |
…eriod of time when the mouse is not moved
…en the preview again, the rotation should be 0
…d mouse;
The initial size of the image preview is controlled by the image itself and the preview page; Remove unnecessary code
中文模板 / Chinese Template
What kind of change does this PR introduce? (check at least one)
PR description
Fixes #
changlog 中提到的两个修改: 缩放作用范围,预览初始大小 源于业务场景的反馈
缩放作用范围: 当前仅鼠标在图片区域内才可以进行缩放,在图片缩小过程中,可能出现鼠标不再位于图片范围内,导致无法继续缩放,不符合直觉。这个问题有两种解决思路,1. 启动图片缩放有效范围仍然为图片区域,但是缩放时缩放中心为鼠标位置,这样就能够保证在缩放过程中鼠标不会出现在图片外的区域。2. 保持缩放中心为预览区域中心位置,启动图片缩放有效范围所有预览区域。两种解决思路在各类型组件库/应用中都有。考虑到代码修改范围以及业务反馈,本次修改采用思路2。
初始预览大小:原来的初始预览大小都是适应页面,如果图片宽高较小,点击预览,图片被放大至适应页面,被放大后的图片如果像素较低,放大至适应页面体验不太好。参考了下其他组件库,基本遵循如果图片小于某个范围,则预览初始大小为图片本身大小,如果图片大于某个范围,则适应页面尺寸进行显示,因此进行了修改。
Changelog
🇨🇳 Chinese
🇺🇸 English
Checklist
Other
Additional information