rive-wasm
rive-wasm copied to clipboard
refactor(layout): add Layout class and enums for canvas fit and align…
Layout module refactor
Description
This pull request refactors the existing Layout class 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
- Move the
Layoutclass to a dedicated filejs/src/layout/Layout.ts - Move the
FitandAlignmentenums to separate files withinjs/src/layout/enums/ - Create a
typesdirectory withinjs/src/layout/to house theLayoutParametersinterface - Update import statements across the codebase to reflect the new file structure
- Export the
Layoutclass and enums fromjs/src/layout/index.ts - Update
js/src/rive.tsto export theLayoutclass and enums
Benefits
- Improved code organization and separation of concerns
- Better adherence to the principle of single responsibility
- Easier maintenance and extensibility of the
Layoutclass and related types - Consistent import paths for the
Layoutclass and enums across the codebase
Documentation
- Existing documentation for the
Layoutclass and enums has been updated to reflect the new file structure and import paths
Risks
No significant risks have been identified.