[pitivi] timeline: Fix scroll when clips are added



commit e039dac8fe2bcfe2227156392bcc3e854e30ba51
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Dec 1 09:27:19 2015 +0100

    timeline: Fix scroll when clips are added
    
    Scroll to the insert position, not to the end of the timeline.
    
    Should have been part of b6468f2cf05f1f445e72c399e10b385bdfcd5019
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D573

 pitivi/timeline/timeline.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 54f553c..9d00376 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -1184,7 +1184,8 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
         # inserted...
         zoom_was_fitted = self.zoomed_fitted
 
-        clip_position = self.__getInsertPosition(position)
+        initial_position = self.__getInsertPosition(position)
+        clip_position = initial_position
 
         self.app.action_log.begin("add asset")
         for obj in objs:
@@ -1213,8 +1214,7 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
         if zoom_was_fitted:
             self._setBestZoomRatio()
         else:
-            self.scrollToPixel(
-                Zoomable.nsToPixel(self.bTimeline.props.duration))
+            self.scrollToPixel(Zoomable.nsToPixel(initial_position))
 
     def __getInsertPosition(self, position):
         if position is None:


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