GNOME Bugzilla – Bug 597703
Trim handles can get glued together
Last modified: 2010-02-05 21:56:38 UTC
Created attachment 144969 [details] backtrace See rhbz#527671: https://bugzilla.redhat.com/show_bug.cgi?id=527671 This only happened once and I haven't been able to reproduce it since.
Found out how to reproduce this. If the start trim handle of a timeline clip is dragged to meet the end trim handle, they will get "glued" together (it looks like the start handle jumps to the right-hand side of the end handle). After that, trying to drag the handle on the left-hand side does nothing -- it's stuck there. Trying to drag the handle on the right-hand side left gives the traceback in the attachment. Continuing to drag it gives this traceback: Traceback (most recent call last):
+ Trace 218136
event)))
self._context.setMode(self._getMode())
followed by these two when the drag operation finished: Traceback (most recent call last): File "pitivi/ui/controller.py", line 140, in button_release_event self._drag_end(item, self._dragging, event) File "pitivi/ui/controller.py", line 181, in _drag_end self.drag_end(item, target, event) File "pitivi/ui/trackobject.py", line 119, in drag_end self._context.finish() AttributeError: 'NoneType' object has no attribute 'finish' Traceback (most recent call last): File "pitivi/ui/controller.py", line 140, in button_release_event self._drag_end(item, self._dragging, event) File "pitivi/ui/controller.py", line 183, in _drag_end if self._ptr_within and self._drag_threshold(): File "pitivi/ui/controller.py", line 195, in _drag_threshold last = self.pos(self._dragging) File "pitivi/ui/controller.py", line 81, in pos bounds = item.get_bounds() AttributeError: 'NoneType' object has no attribute 'get_bounds'
This workaround fixes the traceback. It doesn't fix the fundamental problem that we don't enforce a minimum length for clips in the timeline though. diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py index cf6761e..f431536 100644 --- a/pitivi/timeline/timeline.py +++ b/pitivi/timeline/timeline.py @@ -1249,7 +1249,7 @@ class TrimStartContext(EditingContext): self.default_originals = self._saveValues([focus_timeline_object]) ripple = self.timeline.getObjsBeforeTime(focus.start) - assert not focus.timeline_object in ripple + assert not focus.timeline_object in ripple or focus.duration == 0 self.ripple_originals = self._saveValues(ripple) self.ripple_offsets = self._getOffsets(focus.start, focus.priority, ripple) diff --git a/pitivi/ui/trackobject.py b/pitivi/ui/trackobject.py index fd4e53c..3420a7c 100644 --- a/pitivi/ui/trackobject.py +++ b/pitivi/ui/trackobject.py @@ -398,6 +398,9 @@ class TrackObject(View, goocanvas.Group, Zoomable): y = (self.height + LAYER_SPACING) * self.element.priority self.set_simple_transform(x, y, 1, 0) width = self.nsToPixel(self.element.duration) + min_width = self.start_handle.props.width * 2 + if width < min_width: + width = min_width w = width - self.end_handle.props.width self.name.props.clip_path = "M%g,%g h%g v%g h-%g z" % ( 0, 0, w, self.height, w)
commit ffdc5c39f6c9b5b7b41b6f31ed10a8a5a9a9e652 Author: Brandon Lewis <brandon_lewis@alum.berkeley.edu> Date: Thu Oct 29 15:10:22 2009 -0700 timeline.py,ui.trackobject.py: check in alessandro's fix for 597703