From d51bb39ce5f5535f8b8b4877649e4da40e5c09d5 Mon Sep 17 00:00:00 2001 From: traprog <88223141+traprog@users.noreply.github.com> Date: Fri, 16 Sep 2022 21:08:17 +0900 Subject: [PATCH] Improve how ruler labels are shown --- src/qml/views/keyframes/Ruler.qml | 5 +++-- src/qml/views/timeline/Ruler.qml | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/qml/views/keyframes/Ruler.qml b/src/qml/views/keyframes/Ruler.qml index 3fd75dc217..55454bafe4 100644 --- a/src/qml/views/keyframes/Ruler.qml +++ b/src/qml/views/keyframes/Ruler.qml @@ -31,7 +31,7 @@ Rectangle { } Repeater { - model: parent.width / (intervalSeconds * profile.fps * timeScale) + model: Math.ceil(parent.width / (intervalSeconds * profile.fps * timeScale)) Rectangle { // right edge @@ -41,9 +41,10 @@ Rectangle { width: 1 color: activePalette.windowText x: index * intervalSeconds * profile.fps * timeScale - visible: ((x + width) > tracksFlickable.contentX) && (x < tracksFlickable.contentX + tracksFlickable.width) // left edge + visible: ((x + width + label.width) > tracksFlickable.contentX) && (x < tracksFlickable.contentX + tracksFlickable.width) // left edge Label { + id: label anchors.left: parent.right anchors.leftMargin: 2 anchors.bottom: parent.bottom diff --git a/src/qml/views/timeline/Ruler.qml b/src/qml/views/timeline/Ruler.qml index ccda91253c..5b588c6c3b 100644 --- a/src/qml/views/timeline/Ruler.qml +++ b/src/qml/views/timeline/Ruler.qml @@ -37,7 +37,7 @@ Rectangle { } Repeater { - model: parent.width / (intervalSeconds * profile.fps * timeScale) + model: Math.ceil(parent.width / (intervalSeconds * profile.fps * timeScale)) Rectangle { // right edge @@ -47,9 +47,10 @@ Rectangle { width: 1 color: activePalette.windowText x: index * intervalSeconds * profile.fps * timeScale - visible: ((x + width) > tracksFlickable.contentX) && (x < tracksFlickable.contentX + tracksFlickable.width) // left edge + visible: ((x + width + label.width) > tracksFlickable.contentX) && (x < tracksFlickable.contentX + tracksFlickable.width) // left edge Label { + id: label anchors.left: parent.right anchors.leftMargin: 2 anchors.bottom: parent.bottom