Commit 33c428ab authored by Aswin Mohan's avatar Aswin Mohan Committed by Alexandru Băluț

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
parent 5bba15bb
...@@ -356,7 +356,10 @@ class KeyframeCurve(FigureCanvas, Loggable): ...@@ -356,7 +356,10 @@ class KeyframeCurve(FigureCanvas, Loggable):
if event: if event:
if not event.xdata: if not event.xdata:
return 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) res, value = self.__source.control_source_get_value(xdata)
assert res assert res
pmin = self.__paramspec.minimum pmin = self.__paramspec.minimum
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment