-
Notifications
You must be signed in to change notification settings - Fork 42
fix: remove redundant devicePixelRatio division in icon scaling #485
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
Conversation
The change removes an unnecessary division by devicePixelRatio when scaling icons. The division was redundant because: 1. The image is already being scaled by multiplying with devicePixelRatio in the next line 2. Keeping both operations would effectively cancel each other out 3. This simplifies the logic while maintaining the same visual result The modification ensures cleaner code without changing the actual behavior, as the final scaled image size remains correct. fix: 移除图标缩放中多余的 devicePixelRatio 除法操作 本次修改移除了图标缩放过程中多余的 devicePixelRatio 除法运算,因为: 1. 下一行代码已经通过乘以 devicePixelRatio 进行图像缩放 2. 同时保留两个操作会相互抵消效果 3. 简化逻辑的同时保持相同的视觉效果 base64的requestedSize是没有被缩放的原始size,不能除缩放 pms: BUG-304699
deepin pr auto review关键摘要:
是否建议立即修改:
|
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#485
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @mhduiy - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reviewer's GuideRemoved redundant devicePixelRatio division in the icon scaling logic to simplify the implementation while preserving the final image size. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#485
The change removes an unnecessary division by devicePixelRatio when scaling icons. The division was redundant because:
The modification ensures cleaner code without changing the actual behavior, as the final scaled image size remains correct.
fix: 移除图标缩放中多余的 devicePixelRatio 除法操作
本次修改移除了图标缩放过程中多余的 devicePixelRatio 除法运算,因为:
base64的requestedSize是没有被缩放的原始size,不能除缩放
pms: BUG-304699
Summary by Sourcery
Bug Fixes: