fix: remove redundant devicePixelRatio division in icon scaling#485
Merged
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
Contributor
deepin pr auto review关键摘要:
是否建议立即修改:
|
deepin-ci-robot
added a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
May 15, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#485
18202781743
approved these changes
May 15, 2025
Contributor
|
[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.
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
|
18202781743
pushed a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
May 15, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#485
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: