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

Fix lag caused by monitor ruler code when resizing the last clip of a long project

parent 2618f014
...@@ -36,17 +36,34 @@ Rectangle { ...@@ -36,17 +36,34 @@ Rectangle {
{ {
var projectFps = controller.fps() var projectFps = controller.fps()
root.timeScale = width / root.duration root.timeScale = width / root.duration
if (root.duration < 10 * projectFps) { var displayedLength = root.duration / projectFps;
root.frameSize = projectFps * root.timeScale * 0.2 if (displayedLength < 2 ) {
} else if (duration < 100 * projectFps) { // 1 frame tick
root.frameSize = root.timeScale
} else if (displayedLength < 30) {
// 1 second tick
frameSize = projectFps * root.timeScale frameSize = projectFps * root.timeScale
} else if (duration < 400 * projectFps) { } else if (displayedLength < 150) {
root.frameSize = projectFps * root.timeScale * 2 // 5 second tick
frameSize = 5 * projectFps * root.timeScale
} else if (displayedLength < 300) {
// 10 second tick
frameSize = 10 * projectFps * root.timeScale
} else if (displayedLength < 900) {
// 30 second tick
frameSize = 30 * projectFps * root.timeScale
} else if (displayedLength < 1800) {
// 1 min. tick
frameSize = 60 * projectFps * root.timeScale
} else if (displayedLength < 9000) {
// 5 min tick
frameSize = 300 * projectFps * root.timeScale
} else if (displayedLength < 18000) {
// 10 min tick
frameSize = 600 * projectFps * root.timeScale
} else { } else {
root.frameSize = projectFps * root.timeScale * 4 // 30 min tick
while (root.frameSize < 10) { frameSize = 18000 * projectFps * root.timeScale
root.frameSize *= 4
}
} }
} }
......
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