[vlmc-devel] Track.qml: Compare positions using frames instead of pixels

Yikai Lu git at videolan.org
Thu Jul 28 14:39:31 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Thu Jul 28 21:11:00 2016 +0900| [9f7ef136ac2a49a4704cf9d430cf3284d970de5a] | committer: Yikai Lu

Track.qml: Compare positions using frames instead of pixels

> https://code.videolan.org/videolan/vlmc/commit/9f7ef136ac2a49a4704cf9d430cf3284d970de5a
---

 src/Gui/timeline/Track.qml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/Gui/timeline/Track.qml b/src/Gui/timeline/Track.qml
index 9462341..c590755 100644
--- a/src/Gui/timeline/Track.qml
+++ b/src/Gui/timeline/Track.qml
@@ -239,8 +239,8 @@ Item {
 
                     scrollToTarget( drag.source );
 
-                    // Optimization: Delta delta X should be different
-                    if ( deltaX === drag.source.x - lastX && drag.source.x !== 0 ) {
+                    // Optimization: Delta delta X should be 0
+                    if ( ptof( deltaX ) === ptof( drag.source.x - lastX ) && drag.source.x !== 0 ) {
                         lastX = drag.source.x;
                         return;
                     }
@@ -286,7 +286,7 @@ Item {
                                 var newLinkedClipX = findNewPosition( newX, linkedClipItem, isMagneticMode );
 
                                 // If linked clip collides
-                                if ( Math.abs( newLinkedClipX - newX ) > 1 ) {
+                                if ( ptof( Math.abs( newLinkedClipX - newX ) ) !== 0 ) {
 
                                     // Recalculate target's newX
                                     // This time, don't use magnets
@@ -294,7 +294,7 @@ Item {
                                     newLinkedClipX = findNewPosition( newX, target, false );
 
                                     // And if newX collides again, we don't move
-                                    if ( Math.abs( newLinkedClipX - newX ) > 1 )
+                                    if ( ptof( Math.abs( newLinkedClipX - newX ) ) !== 0 )
                                         newX = oldX;
                                 }
 



More information about the Vlmc-devel mailing list