fix(record): fix selection area and toolbar offset offscreen when drawing small region on HiDPI #824
Conversation
…wing small region on HiDPI On HiDPI displays, boundary checks in mouseReleaseEF used rootWindowRect (physical pixels) while recordX/Y/Width/Height are in logical coordinates, causing the minimum-size-adjusted selection to overflow the screen bounds. - Change boundary checks from rootWindowRect to m_backgroundRect (logical size) - Add lower bound protection for recordX/Y < 0 when adjustment pushes origin negative - Reorder: perform min-size adjustment and bounds clamping before updating sizeTips and toolbar position, avoiding transient incorrect positioning - Apply the same fix to both record and shot mode for consistency bug: https://pms.uniontech.com/bug-view-356099.html
b3f79ae to
68a8ce7
Compare
deepin pr auto review代码审查报告总体评价这段代码主要针对截图/录屏工具的界面绘制、工具栏位置更新和选区边界处理进行了优化。主要改进点包括:
详细审查意见1. 语法逻辑优点
问题与建议
2. 代码质量优点
问题与建议
3. 代码性能优点
问题与建议
4. 代码安全优点
问题与建议
总结这段代码整体质量较高,主要改进了高DPI支持和界面绘制效果。建议的主要改进点包括:
这些改进将进一步提高代码的可维护性、性能和健壮性。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dengzhongyuan365-dev, lzwind 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 |
|
/forcemerge |
|
This pr force merged! (status: unstable) |
fix(toolbar): improve toolbar positioning on HiDPI displays
Adjusted the toolbar positioning logic to account for pixel ratio differences in Qt6+XCB environments. The changes ensure that the toolbar remains within screen bounds by applying consistent boundary checks using logical coordinates. This fix addresses potential offscreen positioning issues when the toolbar is displayed on high-DPI screens.
bug: https://pms.uniontech.com/bug-view-354679.html
fix(record): fix selection area and toolbar offset offscreen when drawing small region on HiDPI
On HiDPI displays, boundary checks in mouseReleaseEF used rootWindowRect
(physical pixels) while recordX/Y/Width/Height are in logical coordinates,
causing the minimum-size-adjusted selection to overflow the screen bounds.
sizeTips and toolbar position, avoiding transient incorrect positioning
bug: https://pms.uniontech.com/bug-view-356099.html