Commit c63280d4 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Improve timeline zone snapping when moving with mouse

parent b74e65dc
......@@ -84,6 +84,18 @@ Rectangle {
var offset = Math.round(mouseX/ timeline.scaleFactor)
if (offset != 0) {
var newPos = Math.max(0, controller.suggestSnapPoint(frameIn + offset,root.snapping))
if (newPos == frameIn + offset) {
// No snap at start, check end
var newPos = Math.max(0, controller.suggestSnapPoint(frameOut + offset,root.snapping))
if (newPos == frameOut + offset) {
newPos = frameIn + offset
} else {
newPos = frameIn + (newPos - frameOut)
}
}
if (newPos < 0) {
newPos = frameIn + offset;
}
frameOut += newPos - frameIn
frameIn = newPos
}
......
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