Skip to main content

Module selection

Module selection 

Source
Expand description

Pure selection / hit-testing types and helpers. Kept separate from the stateful widget so paint, input, and copy code can all use the same predicates without circular dependencies.

Enums§

HitResult
What a mouse hit-test resolved to.
ScrollbarAxis
Selection
What is currently selected. Stores display-row indices; after a sort the “same row” might live at a different position, so callers needing stable identities should track source rows separately.
SortDirection

Functions§

is_cell_selected
true if the selection visually highlights the given cell.
is_column_selected
is_row_selected
screen_to_content
Convert a screen pointer (in window coordinates) to its corresponding content-space (i.e. bounds-relative plus scroll offset) coordinates.
to_grid_relative
Translate an absolute window-space pointer into the grid’s OWN coordinate frame by subtracting the grid’s painted bounds.origin. Every pointer value the widget hands to [GridState] is normalized through this at the event boundary, so all stored positions (click_pos, drag_start, last_mouse_pos, menu/prompt anchors) live in one consistent grid-relative frame regardless of where the widget is nested in the window. A grid at window origin (as in the sample app and older tests) is the identity case.