Skip to content

Commit

Permalink
Support scrolling in squoosh (#1809)
Browse files Browse the repository at this point in the history
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
rylin8 authored Dec 3, 2024
1 parent 041b483 commit 9b12d11
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 9b12d11

Please sign in to comment.