[vlmc-devel] Clip.qml: Set hotSpot wisely

Yikai Lu git at videolan.org
Tue Jul 26 16:12:52 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Tue Jul 26 23:08:41 2016 +0900| [3adf9b08984b8913ea429b15b783a3f93ffb6902] | committer: Yikai Lu

Clip.qml: Set hotSpot wisely

> https://code.videolan.org/videolan/vlmc/commit/3adf9b08984b8913ea429b15b783a3f93ffb6902
---

 src/Gui/timeline/Clip.qml  | 8 ++++++++
 src/Gui/timeline/Track.qml | 1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Gui/timeline/Clip.qml b/src/Gui/timeline/Clip.qml
index bc6b6fa..21500da 100644
--- a/src/Gui/timeline/Clip.qml
+++ b/src/Gui/timeline/Clip.qml
@@ -63,6 +63,14 @@ Rectangle {
             findClipItem( linkedClip ).selected = true;
     }
 
+    onXChanged: {
+        if ( sView.flickableItem.contentX + sView.width <
+                x + width + initPosOfCursor + sView.sViewPadding )
+            Drag.hotSpot.x = 0;
+        else if ( sView.flickableItem.contentX + sView.sViewPadding > x + initPosOfCursor )
+            Drag.hotSpot.x = width;
+    }
+
     onYChanged: {
         y -= y % trackHeight;
         // Don't move outside its TrackContainer
diff --git a/src/Gui/timeline/Track.qml b/src/Gui/timeline/Track.qml
index b38f442..d2fae7f 100644
--- a/src/Gui/timeline/Track.qml
+++ b/src/Gui/timeline/Track.qml
@@ -183,7 +183,6 @@ Item {
                         // Never show the background behind the timeline
                         var newContentX = sView.flickableItem.contentWidth - sView.width;
                         if ( newContentX >= 0 ) {
-                            drag.source.Drag.hotSpot.x = 0;
                             sView.flickableItem.contentX = newContentX;
                         }
                     }



More information about the Vlmc-devel mailing list