Commit 32cb222f authored by luyikei's avatar luyikei

Timeline: Simplify centering drag.source

parent 80d10c8a
......@@ -250,6 +250,7 @@ Rectangle {
}
onYChanged: {
y -= y % trackHeight;
// Don't move outside its TrackContainer
// For Top
var yToMoveUp = track.mapToItem( container, 0, 0 ).y + y;
......
......@@ -249,8 +249,6 @@ Item {
}
}
drag.source.y = drag.source.y - drag.y + track.height / 2 - 1; // Adjust to the center
// Optimization: Delta delta X should be different
if ( deltaX === drag.source.x - lastX ) {
lastX = drag.source.x;
......
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