Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support scrolling in squoosh (#1809)
Fixes #1787. When a view has scrolling enabled, add it to the list of child composables so that SquooshRoot() can recompose it as its own SquooshRoot(). During this composition, the scrollable view gets a Modifier.scrollable() that handles scroll input. The scroll events are used to calculate a scroll position, and the scroll position is saved into a State<Offset> object that is passed to the renderer and used to translate the children of the scrollable view. In order to calculate the size of a scrollable view's child contents, the "content_size" feature flag has been turned on in taffy. This allows taffy to calculate the size of a node's children, which we save into new content_width and content_height fields in layout. A scrolling test, validation example and unit test have been added.
- Loading branch information