[pitivi] elements: Update tooltip with ts of dragged keyframe



commit 33c428ab8861de9f5b3259de9058967503995013
Author: Aswin Mohan <aswinmmohan gmail com>
Date:   Mon Mar 20 03:47:54 2017 +0100

    elements: Update tooltip with ts of dragged keyframe
    
    When a Keyframe is Dragged beyond another keyframe, the tooltip updates
    showing the timestamp of the hovered event.
    
    The problem is that when a keyframe is clicked, and dragged the tooltip
    is updated with the timestamp of the hovering mouse. The problem rests
    with the __update_tooltip() method which updates the tooltip with the
    value of the hovered event, rather than the dragged event.
    
    To fix this, we check if the keyframe is clicked, when the
    __update_tooltip() method is called, if it is clicked then we set the
    tooltip to show offset of the keyframe, which does not update after it
    has reached another keyframe.
    
    Fixes T7717
    
    Differential Revision: https://phabricator.freedesktop.org/D1695

 pitivi/timeline/elements.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index d315526..9c66b17 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -356,7 +356,10 @@ class KeyframeCurve(FigureCanvas, Loggable):
         if event:
             if not event.xdata:
                 return
-            xdata = max(self.__line_xs[0], min(event.xdata, self.__line_xs[-1]))
+            if self.__offset is not None:
+                xdata = self.__offset
+            else:
+                xdata = max(self.__line_xs[0], min(event.xdata, self.__line_xs[-1]))
             res, value = self.__source.control_source_get_value(xdata)
             assert res
             pmin = self.__paramspec.minimum


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