Skip to content

Add smooth scroll to the scroll view.#1056

Open
t800-x wants to merge 3 commits intolapce:mainfrom
t800-x:smooth_scroll
Open

Add smooth scroll to the scroll view.#1056
t800-x wants to merge 3 commits intolapce:mainfrom
t800-x:smooth_scroll

Conversation

@t800-x
Copy link
Copy Markdown

@t800-x t800-x commented Mar 29, 2026

Added a smooth_scroll style that animates the scroll ticks with a linear animation. Had to move the set_positions() call out of apply_scroll_delta() cause while animating the tree is being modified and read at the same time, and it was causing understory_box_tree to panic and crash.

I tried to use exponential decay instead of a linear curve but had problems chaining scroll ticks in quick succession. Did the best I could.

@jrmoulton
Copy link
Copy Markdown
Collaborator

jrmoulton commented Apr 1, 2026

Exciting! Can you instead let the style prop be a DirectTranstion instead of just a bool. that should help clean up the state management as well

@t800-x
Copy link
Copy Markdown
Author

t800-x commented Apr 1, 2026

Alright mate, done that. Also fixed a clippy warning in tiny_skia/src/lib.rs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants