[][src]Function nannou::ui::graph::algo::scroll_offset

pub fn scroll_offset(graph: &Graph, idx: NodeIndex<u32>) -> [f64; 2]

Return the scroll_offset for the widget at the given index.

The offset is retrieved from the widget that is the immediate depth_parent of the widget at the given idx unless:

  • the immediate depth_parent of idx is also a graphic_parent to idx. In this case, NO_OFFSET will be returned, as child widgets that are graphical elements of their parents should not be affected by scrolling.
  • one of the position parents also has the same depth_parent. In this case, NO_OFFSET will be returned, as we know that our scroll offset has already been applied via the widget to which we are relatively positioned.