Skip to content

Allow aligning lottie animations with fixed aspect ratio - #2472

Merged
tf merged 8 commits into
codevise:masterfrom
tf:lottie-align
Aug 17, 2026
Merged

Allow aligning lottie animations with fixed aspect ratio#2472
tf merged 8 commits into
codevise:masterfrom
tf:lottie-align

Conversation

@tf

@tf tf commented Aug 17, 2026

Copy link
Copy Markdown
Member

REDMINE-21349

tf added 8 commits August 17, 2026 14:52
Analogous to the preview and thumbnail views, file types can now
register a Backbone view which the background positioning dialog
renders in place of the image the file points at. Dragging the file to
position it happens on a wrapper which shrinks to the size of whatever
the view renders.
Rendering the positioning view of the file type with cover fit and
telling it about position changes replaces the cropped background
image. Positions are passed in percent, just like the background
position they stand in for.
Both the file to drag and the crop previews render the animation in a
loop, using the player's own layout options to crop and align it. Since
the position may change before the player has read the file, it is
applied again once the animation has loaded.
Cropping an animation to an aspect ratio leaves the choice which part
of it to keep. The player's layout alignment covers the same range as
the crop position, only in fractions instead of percent.
Just like for videos, cropping an animation to an aspect ratio enables
the menu item which opens the background positioning dialog. The
preview shows the aspect ratio the animation is actually cropped to.
Creating the player for the file rendered in a canvas and destroying
it again is the same for the thumbnail, the file meta data preview and
the box of the positioning dialog. What differs is playback and how
each of them reacts to the animation having been read.
The preview and the box of the positioning dialog size themselves
based on dimensions which only the animation provides. The player has
drawn its first frame into a canvas of the size the view had before and
only picks up the new one via a resize observer, which fires too late to
keep that frame from being stretched. Staying invisible until the player
has been resized hides this, while keeping the box in the layout so
displaying it does not reflow the dialog.
Thumbnails of images and videos fill their box just the same, which
keeps rows of the file list from mixing letterboxed and filled
thumbnails.
@tf tf added this to the v17.2 milestone Aug 17, 2026
@tf
tf merged commit 653c0a5 into codevise:master Aug 17, 2026
17 of 18 checks passed
@tf
tf deleted the lottie-align branch August 18, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant