refactor(layout): add Layout class and enums for canvas fit and align…#358
Open
samavati wants to merge 1 commit intorive-app:masterfrom
Open
refactor(layout): add Layout class and enums for canvas fit and align…#358samavati wants to merge 1 commit intorive-app:masterfrom
samavati wants to merge 1 commit intorive-app:masterfrom
Conversation
…ment The Layout class provides methods to manage the fit and alignment of a Rive animation within an HTML canvas. It includes the following features: - Fit enum with options: Cover, Contain, Fill, FitWidth, FitHeight, None, ScaleDown - Alignment enum with options: Center, TopLeft, TopCenter, TopRight, CenterLeft, CenterRight, BottomLeft, BottomCenter, BottomRight - Constructor to set layout parameters (fit, alignment, min/max X/Y coordinates) - Methods to get runtime Fit and Alignment values for the Rive canvas - Helper method to create a new Layout instance with modified parameters This commit also exports the Layout class and enums from the rive.ts entry point.
Contributor
Author
|
Hi @HayesGordon , I haven't heard back about this pull request yet and I'm eager to get your feedback on the refactoring changes to the Layout class. Thanks for your time! |
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.
Layout module refactor
Description
This pull request refactors the existing
Layoutclass and related enums for managing the fit and alignment of Rive animations within an HTML canvas. The refactoring aims to improve code organization, maintainability, and adherence to best practices.Changes
Layoutclass to a dedicated filejs/src/layout/Layout.tsFitandAlignmentenums to separate files withinjs/src/layout/enums/typesdirectory withinjs/src/layout/to house theLayoutParametersinterfaceLayoutclass and enums fromjs/src/layout/index.tsjs/src/rive.tsto export theLayoutclass and enumsBenefits
Layoutclass and related typesLayoutclass and enums across the codebaseDocumentation
Layoutclass and enums has been updated to reflect the new file structure and import pathsRisks
No significant risks have been identified.