https://bugs.kde.org/show_bug.cgi?id=452679

            Bug ID: 452679
           Summary: Zoom position wrong if razor tool is active
           Product: kdenlive
           Version: git-master
          Platform: Ubuntu Packages
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: User Interface
          Assignee: j...@kdenlive.org
          Reporter: mk...@gmx.at
  Target Milestone: ---

SUMMARY
When Changing the Zoom Level of the Timeline using the scroll wheel the
centered position changes if currently the razor tool is active.


STEPS TO REPRODUCE
1. Open a project containing some clips (doesn't matter how much, they need to
be long enough that you can scroll horizontally
2. Place the cursor somewhere (as location reference)
3. Move the mouse on top of a clip and to a location that you can easily
remember e.g. the cursor
3. Select the razor tool using Hotkeys
4. Zoom in or out using the mouse wheel (at least twice)

OBSERVED RESULT
The cursor moves away from the mouse

EXPECTED RESULT
The position below the mouse should stay the same

SOFTWARE/OS VERSIONS
Kdenlive: 22.07.70 (rev. 7b7c568ba)
Package Type: Unknown/Default
MLT: 7.7.0
Qt: 5.12.8 (built against 5.12.8 x86_64-little_endian-lp64)
Frameworks: 5.68.0
System: Ubuntu 20.04.4 LTS
Kernel: linux 5.8.0-63-generic
CPU: x86_64
Windowing System: xcb
Movit (GPU): disabled
Track Compositing: frei0r.cairoblend

ADDITIONAL INFORMATION
This is most likely a duplicate of https://bugs.kde.org/show_bug.cgi?id=423955
but this has been closed due to missing information

I also did some digging:

During zooming with the mouse wheel the centered Position (gathered from
src/timeline2/view/TimelineController::getMousePos()) should be constant. This
part works, but the current mouse position is wrong.
This wrong information originates from
src/timeline2/view/qml/timeline.qml:getMousePos() ~Line 229 . Here the values
gathered from the dragProxy are wrong.
Those values are beeing updated inside
src/timeline2/view/qml/Clip.qml:onPositionChanged ~Line 352
Those updates do not happen, because the razor disables the MouseArea

Based on my understanding there shouldn't be dragging active if the razor tool
is active. Thus ending the dragging if the tool is changed fixed that bug:

diff --git a/src/timeline2/view/timelinewidget.cpp
b/src/timeline2/view/timelinewidget.cpp
index 510cd39fa..e9cf22b85 100644
--- a/src/timeline2/view/timelinewidget.cpp
+++ b/src/timeline2/view/timelinewidget.cpp
@@ -410,6 +410,7 @@ void TimelineWidget::zoneUpdatedWithUndo(const QPoint
&oldZone, const QPoint &ne

 void TimelineWidget::setTool(ToolType::ProjectTool tool)
 {
+    QMetaObject::invokeMethod(rootObject(), "endDrag", Qt::DirectConnection);
     rootObject()->setProperty("activeTool", int(tool));
 }

Tests seem to be unaffected by those changes

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to