Skip to main content

Module viewport

Module viewport 

Source
Expand description

Where a virtualized surface is scrolled to.

A RenderOnce builder is rebuilt every frame and cannot carry anything, so a list, a table, or a tree that only draws its viewport has nowhere of its own to keep the offset. Keying one scroll handle by the surface’s identity keeps the position across rebuilds without making every caller own a GPUI handle, and it lets a surface built on top of another one move it by name.

Functions§

reveal_row
Brings row index into view by the shortest move that gets it there, and leaves the offset alone when the row is already on screen.
scroll_to_row
Brings row index of the surface with this identity to the bottom edge.