Skip to main content

split_sheet_drag

Function split_sheet_drag 

Source
pub fn split_sheet_drag(
    grow: f32,
    list_offset: f32,
    size: f32,
    floor: f32,
    max: f32,
) -> (f32, f32)
Expand description

How one movement of the finger is shared out, in px: grow is how far it went up (negative for down), list_offset how far the list inside is scrolled, size how tall the sheet is, and floor and max how low and high it may go.

Returns (sheet, list): how far the sheet grows, and how far the list’s offset grows. They always add up to grow, so no movement of the finger is lost — what the sheet cannot take past its floor goes to the list, whose own physics refuses it at its edge and says so.