Resize artboard every frame for Fit.LAYOUT#450
Draft
mfazekas wants to merge 1 commit intorive-app:masterfrom
Draft
Resize artboard every frame for Fit.LAYOUT#450mfazekas wants to merge 1 commit intorive-app:masterfrom
mfazekas wants to merge 1 commit intorive-app:masterfrom
Conversation
State machine keyframes can overwrite artboard width via CoreRegistry::setDouble during advance(). The one-shot requireArtboardResize flag is already consumed, so the artboard stays at the keyframe value. iOS re-applies artboard dimensions every frame in drawRive; this matches that behavior. Also re-arm requireArtboardResize when artboard is null or surface is 0x0, and set it in onSurfaceTextureSizeChanged/Available. Fixes rive-app#446 (issue 2)
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.
Fixes #446 (issue 2)
Problem
State machine keyframes can overwrite
m_Widthevery frame viaCoreRegistry::setDouble(artboard, widthPropertyKey, ...)duringadvance(). SinceresizeArtboard()only runs once (one-shotrequireArtboardResizeflag), the artboard stays at the keyframe value.Reproduced with
layout_test.riv— 9/10 launches show wrong artboard width.For reference, iOS re-applies artboard dimensions every frame in
drawRiverather than using a one-shot flag.Changes
RiveArtboardRenderer.draw()— callresizeArtboard()every frame whenfit == Fit.LAYOUTRiveArtboardRenderer.resizeArtboard()— re-arm flag when artboard is null or surface is 0×0RiveAnimationView.onSurfaceTextureSizeChanged/Available()— setrequireArtboardResize = trueVerified
layout_test.riv— 9/10 wrong before fix, 10/10 correct after.