Repository navigation
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: JWWTSL 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 |
Reviewer's GuideUpdates NavigationWidget.qml to transpose navigation-mask coordinates, dimensions, and drag ratios for 90°/270° rotations, fixing mask placement and drag direction while preserving unrotated and 180° behavior. Sequence diagram for rotated navigation mask draggingsequenceDiagram
participant User
participant NavigationWidget
participant MainImage
User->>NavigationWidget: Drag navigation mask
NavigationWidget->>NavigationWidget: updateImagePositionBasedOnMask()
alt 90°/270° rotation
NavigationWidget->>NavigationWidget: Swap xRatio and yRatio
else 0°/180° rotation
NavigationWidget->>NavigationWidget: Keep xRatio and yRatio
end
NavigationWidget->>MainImage: Update targetImage.x and targetImage.y
Flow diagram for rotation-aware navigation mask mappingflowchart LR
A[NavigationWidget.qml] --> B{currentRotation % 180 !== 0}
B -->|No| C[Use targetImage x/y and painted width/height]
B -->|Yes| D[Transpose x/y, width/height, and Window dimensions]
C --> E[refreshNaviMaskImpl]
D --> E
E --> F[Update navigation mask position and size]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
1. Root cause: onCurrentRotationChanged calls currentImage.updateMask() immediately, but targetImage has a 50ms delayUpdate timer before reload, so paintedWidth/paintedHeight are still pre-rotation values 2. Fix: add rotationRefreshTimer (200ms) to defer updateMask() until after targetImage finishes reloading with rotated pixel dimensions 3. Impact: only affects navigation mask position after rotation; existing onPaintedWidthChanged/onPaintedHeightChanged signals provide self- correction as a fallback Log: Fixed navigation window mask position error after rotating zoomed image Influence: 1. Test zoom in then rotate image, verify nav mask position is correct 2. Test rapid consecutive rotations, verify mask settles correctly 3. Test rotation on image smaller than window, verify no nav shown fix: 修复旋转后导航窗口蒙皮位置错误 1. 根因:onCurrentRotationChanged 立即调用 currentImage.updateMask(), 但 targetImage 有 50ms delayUpdate 延迟重载,paintedWidth/ paintedHeight 仍为旋转前值,导致蒙皮位置计算使用过时数据 2. 方案:新增 rotationRefreshTimer(200ms)延迟调用 updateMask(), 等待 targetImage 完成重载后再刷新蒙皮位置 3. 影响:仅影响旋转后导航窗口蒙皮位置;已有的 onPaintedWidthChanged/onPaintedHeightChanged 信号提供自纠正兜底 Log: 修复放大图片旋转后导航窗口蒙皮位置错误 Influence: 1. 测试放大后旋转图片,验证导航蒙皮位置正确 2. 测试快速连续旋转,验证蒙皮最终位置正确 3. 测试小于窗口的图片旋转,验证不显示导航窗口 PMS: BUG-373837
e43145f to
3cced3b
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: ['无需修改,语法逻辑正确。'] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: ['代码质量良好,注释充分,无需修改。'] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: ['建议将 interval: 200 提取为 property 常量,如 property int rotationRefreshInterval: 200,并在 Timer 中引用。'] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: ['无安全风险,无需安全加固。'] 💡 改进建议代码示例// 建议将魔法数字提取为属性常量 Item {
// 旋转后主视图 targetImage 有 50ms delayUpdate 延迟重载,立即刷新蒙皮
// 会使用旋转前的 paintedWidth/paintedHeight,导致蒙皮位置错误
// 200ms = 50ms delayUpdate + ~150ms 异步图片重载余量
property int rotationRefreshInterval: 200
Timer {
id: rotationRefreshTimer
interval: rotationRefreshInterval
repeat: false
onTriggered: currentImage.updateMask()
}
}本报告由 AI 代码审查工具自动生成 |
fix: correct nav mask coords after image rotation
mapped main-view X/Y directly to nav-thumbnail X/Y without rotation
transform; after 90°/270° rotation swapWidthAndHeight() swaps
paintedWidth/paintedHeight so axes are transposed but mapping was not
paintedWidth/Height, and Window.width/height in refreshNaviMaskImpl();
swap xRatio/yRatio in updateImagePositionBasedOnMask() for drag
90°/270° rotations; 0°/180° behavior unchanged
Log: 修复放大图片旋转后导航窗口蒙皮位置和拖拽方向错乱
Influence:
fix: 修复图片旋转后导航窗口蒙皮坐标错乱
X/Y 坐标直接映射到导航缩略图 X/Y,未做旋转变换;旋转 90°/270° 时
swapWidthAndHeight() 交换 paintedWidth/paintedHeight 导致坐标轴转置但
映射未同步交换
targetImage.x/y、paintedWidth/Height、Window.width/height;在
updateImagePositionBasedOnMask() 中交换 xRatio/yRatio 实现拖拽方向映射
方向;0°/180° 行为不变
Log: 修复放大图片旋转后导航窗口蒙皮位置和拖拽方向错乱
Influence:
PMS: BUG-373837
Summary by Sourcery
Fix navigation mask synchronization after image rotation by refreshing it after the rotated image state is ready.
Bug Fixes: