Repository navigation
Rollup animation fix and test - #298
Merged
Merged
Conversation
Contributor
|
I do not see an overlap with the test file at |
Contributor
Author
|
I didn't accurately describe the behavior (it's a momentary shift, not an overlap), and it's pretty subtle. I'm attaching an annotated video which shows the behavior (captured with Chrome on MacOS). rollup-before-after.mp4 |
Contributor
Author
|
I would encourage you to download the video and step through it frame-by-frame as opposed to trying to watch it in realtime in Github's video player. |
Contributor
|
@dheitmueller Great catch! I would however:
|
Contributor
Author
|
@palemieux Thanks for the feedback. I'll implement your two suggested changes and re-push the patch series. |
dheitmueller
force-pushed
the
rollup-animation-test
branch
from
November 9, 2026 18:33
1b3edcb to
8ff13ef
Compare
palemieux
requested changes
Nov 9, 2026
renderHTML() animates a region that is aligned after when enableRollUp is set and the last line of the previous ISD is the second to last line of the current one, but nothing tests it: the reference files test renders each ISD on its own. Render a roll-up caption ISD by ISD in the browser, as a player does, passing the state that renderHTML() returns to the next call, and check that: * the lines start the animation from where they were: the offset of the animation is the distance that the lines of the previous ISD moved up to get to their place in the current one, with lines of the same size and with lines of different sizes, with the line height of the font and with a smaller one; * they do not roll up if enableRollUp is not set, if the lines of the previous ISD are not the first lines of the current one, and in the first ISD. The tests with a line height smaller than the font fail until the distance of the animation is the one between the lines instead of the height of the box of the last line.
When renderHTML() is called with enableRollUp, the region is moved up
by one line and slides back into place. The distance was the height of
the box of the last line, which is the distance that the lines have to
move only if the line height is the natural one of the font ("normal").
With a smaller line height, such as the one row that CEA-608
conversions set with tts:lineHeight so that rows stay on a cell grid,
the box of a line (the ascent and the descent of the font) is taller
than the distance between two lines: with a monospace font of 1c on a
1280x720 picture with 19 rows the box is 47 px and the distance 38 px.
The lines then start 9 px lower than where the previous lines were,
which shows as a small jump before they slide.
Use the distance between the after edges of the last two lines, which
is the height that the last line adds to the region, and so how far
the previous lines have to move. There are at least two lines in the
region at this point. The final position of the lines is not changed,
nor is the condition for the animation.
dheitmueller
force-pushed
the
rollup-animation-test
branch
from
November 9, 2026 19:18
8ff13ef to
7b86fc5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch series addresses a rendering bug when using the rollup mode that resulted in overlapping rows. Also included it a test for this issue.
Closes #299