Fix snapping issues (disable snapping on high zoom levels)

Fix clip incorrectly moving after releasing mouse on resize
Related to #183
parent 9f129e22
......@@ -281,8 +281,8 @@ Column{
bubbleHelp.hide()
if (shiftTrim || clip.groupTrimData == undefined) {
// We only resize one element
controller.requestItemResize(clip.clipId, clip.originalDuration, false, false, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, false, true, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.originalDuration, false, false, 0, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, false, true, 0, shiftTrim)
} else {
var updatedGroupData = controller.getGroupData(clip.clipId)
controller.processGroupResize(clip.groupTrimData, updatedGroupData, false)
......@@ -305,8 +305,8 @@ Column{
onTrimmedOut: {
bubbleHelp.hide()
if (shiftTrim || clip.groupTrimData == undefined) {
controller.requestItemResize(clip.clipId, clip.originalDuration, true, false, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, true, true, root.snapping, shiftTrim)
controller.requestItemResize(clip.clipId, clip.originalDuration, true, false, 0, shiftTrim)
controller.requestItemResize(clip.clipId, clip.lastValidDuration, true, true, 0, shiftTrim)
} else {
var updatedGroupData = controller.getGroupData(clip.clipId)
controller.processGroupResize(clip.groupTrimData, updatedGroupData, true)
......
......@@ -228,7 +228,7 @@ Rectangle {
property int spacerFrame: -1
property int spacerClickFrame: -1
property real timeScale: timeline.scaleFactor
property real snapping: timeline.snap ? 10 / Math.sqrt(timeScale) - 0.5 : -1
property real snapping: (timeline.snap && (timeScale < 2 * baseUnit)) ? 10 / Math.sqrt(timeScale) - 0.5 : -1
property var timelineSelection: timeline.selection
property int trackHeight
property int copiedClip: -1
......
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