[pitivi] timeline: Fix clip handle jumping when starting drag&drop



commit c8e9c63e5bde2ef559a4323a3284a7b3262a8270
Author: kiren <kirenpillay1 gmail com>
Date:   Wed Mar 4 23:18:40 2020 +0200

    timeline: Fix clip handle jumping when starting drag&drop
    
    The position passed to GES was incorrectly calculated for both left and right
    handles. For the left one a 1px jump was caused by `__drag_start_x` being
    between 0 and 1. For the right one, a jump of a few pixels was caused by
    ignoring both `__drag_start_x` and the width of the handle, as the right edge
    position must be passed to GES.
    
    Fixes #2295

 pitivi/timeline/timeline.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index fc5455e3..f088b765 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1345,9 +1345,9 @@ class Timeline(Gtk.EventBox, Zoomable, Loggable):
         self.editing_context.set_mode(mode)
 
         if self.editing_context.edge is GES.Edge.EDGE_END:
-            position = self.pixel_to_ns(x)
+            position = self.pixel_to_ns(x - int(self.__drag_start_x) + 
self.__clicked_handle.get_allocated_width())
         else:
-            position = self.pixel_to_ns(x - self.__drag_start_x)
+            position = self.pixel_to_ns(x - int(self.__drag_start_x))
 
         self._set_separators_prelight(False)
         res = self.get_layer_at(y, prefer_ges_layer=self._on_layer)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]