fix(clipboard): fix jagged image under fractional scaling - #274
Conversation
1. Include QGuiApplication header for qGuiApp global pointer 2. Reduce border width from 4.0 to 3.0 for cleaner appearance 3. Use qGuiApp->devicePixelRatio() to get screen DPR instead of pixmap's potentially inaccurate devicePixelRatioF() Log: Fix jagged edges in clipboard images at non-100% display scale ratios fix(clipboard): 修复缩放比下剪贴板图片锯齿问题 1. 添加 QGuiApplication 头文件以使用 qGuiApp 全局指针 2. 将边框宽度从 4.0 调整为 3.0,改善视觉效果 3. 使用 qGuiApp->devicePixelRatio() 获取屏幕 DPR,替代 pixmap 自身可能不准确的 devicePixelRatioF() Log: 修复非 100% 缩放比下剪贴板图片锯齿明显的问题 PMS: BUG-315075
|
Hi @MyLeeJiEun. Thanks for your PR. 😃 |
|
Hi @MyLeeJiEun. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts how rounded clipboard preview pixmaps are rendered under fractional display scaling, using the global QGuiApplication DPI instead of the pixmap’s own DPR and slightly reducing the border width for visual refinement. Sequence diagram for clipboard pixmap rounding under fractional scalingsequenceDiagram
participant ClipboardPreview
participant GetRoundPixmap
participant qGuiApp
participant Pixmap
ClipboardPreview->>GetRoundPixmap: GetRoundPixmap(pix, borderColor)
alt [qGuiApp is nonnull]
GetRoundPixmap->>qGuiApp: devicePixelRatio()
qGuiApp-->>GetRoundPixmap: dpr
else [qGuiApp is null]
GetRoundPixmap->>Pixmap: devicePixelRatioF()
Pixmap-->>GetRoundPixmap: dpr
end
GetRoundPixmap-->>ClipboardPreview: roundedPixmap
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Consider avoiding a dependency on the global qGuiApp inside GetRoundPixmap by passing the device pixel ratio as a parameter instead, which will make the function easier to reuse and test independently of application state.
- Now that borderWidth and radius are magic numbers used for visual tuning, you might want to centralize them as named constants (e.g., constexpr) to make future adjustments and consistency across the codebase easier.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider avoiding a dependency on the global qGuiApp inside GetRoundPixmap by passing the device pixel ratio as a parameter instead, which will make the function easier to reuse and test independently of application state.
- Now that borderWidth and radius are magic numbers used for visual tuning, you might want to centralize them as named constants (e.g., constexpr) to make future adjustments and consistency across the codebase easier.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, MyLeeJiEun 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 |
Log: Fix jagged edges in clipboard images at non-100% display scale ratios
fix(clipboard): 修复缩放比下剪贴板图片锯齿问题
Log: 修复非 100% 缩放比下剪贴板图片锯齿明显的问题
PMS: BUG-315075
Summary by Sourcery
Adjust clipboard image rendering to improve visual quality under fractional display scaling.
Bug Fixes:
Enhancements: