Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve how ruler labels are shown #1366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

traprog
Copy link
Contributor

@traprog traprog commented Oct 27, 2022

No description provided.

@bmatherly
Copy link
Member

I tested this. I think it is good. I do not love how the time can be printed beyond the ruler. But this is probably better than cutting it of when it can be shown.

image

@ddennedy
Copy link
Member

Why? I am not keen to make personal little changes that might introduce some side effects or problem.

@traprog
Copy link
Contributor Author

traprog commented Oct 28, 2022

I think this one is an obvious visual improvement that can benefit most users, not just me personally without apparent side effects.

Technically though, Repeater's model property holds the number of repeated objects, and

parent.width / (intervalSeconds * profile.fps * timeScale)

gets rounded up half way, and rounded down otherwise.
Math.ceil ensures that at least one objects is shown even if the ruler's width (parent.width) is really small.
If the ruler's width is the same as the interval, two objects are shown, and so forth.

label.width is taking the hint from width in (x + width), which looks like it's intended to be there to hide a object only if the right side of the entire object reaches the tracksFlickable.contentX.

@traprog
Copy link
Contributor Author

traprog commented Oct 28, 2022

I do not love how the time can be printed beyond the ruler.

I can make the label to show only if it is within the ruler by adding:

&& (x + width + label.width) < rulerTop.width

to

44: visible: ((x + width + label.width) > tracksFlickable.contentX) && (x < tracksFlickable.contentX + tracksFlickable.width)  // left edge

in Ruler.qml.

@ddennedy
Copy link
Member

As for "why?" please do not assume I have read the forum, and feel free to link to an explanation:
https://forum.shotcut.org/t/improve-timeline-keyframe-ruler-label-display/36251

@ddennedy
Copy link
Member

ddennedy commented Nov 11, 2022

This is a very minor finesse thing that I am not interested in to change in the near term as there are currently two development paths: stability (with fixes) and major changes. But I am leaving it open to consider for future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants