Repository navigation
feat: Disable two-finger rotation gesture in pinch handling. - #184
Conversation
Reviewer's GuideAPIRemove the gesture-rotation signal and its ViewPanel connection because pinch gestures no longer complete image rotations.
ImplementationKeep pinch handling for zoom while suppressing rotation, and remove the gesture-only rotation completion logic and state.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="libimageviewer/viewpanel/scen/imagegraphicsview.h" line_range="191" />
<code_context>
- * @brief OnFinishPinchAnimal
- * 旋转图片松开手指回到特殊位置结束动画槽函数
- */
- void OnFinishPinchAnimal();
-
private:
</code_context>
<issue_to_address>
**Test target fails to compile**
When the test target compiles `test_LibImageGraphicsView.cpp`, removing the declaration and definition leaves the test calling the missing `OnFinishPinchAnimal()` member, so the test target fails to compile.
Keep the test and class API consistent by restoring the slot or updating the test to use the replacement.
Also at `libimageviewer/viewpanel/scen/imagegraphicsview.cpp:1442`.
</issue_to_address>
### Comment 2
<location path="libimageviewer/viewpanel/scen/imagegraphicsview.cpp" line_range="1355" />
<code_context>
- if (!m_rotateflag) {
- qDebug() << "ratateflag" << gesture->lastRotationAngle();
- gesture->setRotationAngle(gesture->lastRotationAngle());
- return;
- }
- qreal rotationDelta = gesture->rotationAngle() - gesture->lastRotationAngle();
</code_context>
<issue_to_address>
**Later zooms use stale center**
When the final pinch event reports `RotationAngleChanged`, including when it also reports `GestureFinished`, `pinchTriggered` returns before the `GestureFinished` cleanup resets `m_isFirstPinch` and handles the saved `m_centerPoint`, so the next pinch reuses the previous center and anchors zoom at the wrong location.
Ensure the `GestureFinished` cleanup runs before returning from the rotation-change branch.
</issue_to_address>| } | ||
| // 新需求:不再支持双指触发旋转,仅保留双指缩放 | ||
| gesture->setRotationAngle(gesture->lastRotationAngle()); | ||
| return; |
There was a problem hiding this comment.
🟡 Medium · Later zooms use stale center
When the final pinch event reports RotationAngleChanged, including when it also reports GestureFinished, pinchTriggered returns before the GestureFinished cleanup resets m_isFirstPinch and handles the saved m_centerPoint, so the next pinch reuses the previous center and anchors zoom at the wrong location.
Ensure the GestureFinished cleanup runs before returning from the rotation-change branch.
Prompt for AI agents
In `libimageviewer/viewpanel/scen/imagegraphicsview.cpp` at line 1355:
**Later zooms use stale center**
When the final pinch event reports `RotationAngleChanged`, including when it also reports `GestureFinished`, `pinchTriggered` returns before the `GestureFinished` cleanup resets `m_isFirstPinch` and handles the saved `m_centerPoint`, so the next pinch reuses the previous center and anchors zoom at the wrong location.
Ensure the `GestureFinished` cleanup runs before returning from the rotation-change branch.Requirement port: backport 0e90e77 from develop/eagle to master. Pinch gestures no longer trigger rotation, only two-finger zoom is kept. Keep non-gesture rotation paths unchanged, including toolbar/shortcut rotation and delayed rotate save behavior. Log: as title PMS: https://pms.uniontech.com/task-view-387789.html PMS: https://pms.uniontech.com/task-view-387787.html
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, 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 |
|
/merge |
|
This pr cannot be merged! (status: unstable) |
|
/merge |
Requirement port: backport 0e90e77 from develop/eagle to master. Pinch gestures no longer trigger rotation, only two-finger zoom is kept. Keep non-gesture rotation paths unchanged, including toolbar/shortcut rotation and delayed rotate save behavior.
Log: as title
Task: https://pms.uniontech.com/task-view-387789.html https://pms.uniontech.com/task-view-387787.html
Summary by Sourcery
Disable image rotation from pinch gestures while retaining two-finger zoom and existing non-gesture rotation controls.
Bug Fixes:
Enhancements:
Chores: