pub fn render<V: 'static>(
id: impl Into<ElementId>,
doc: &Doc,
layouts: &BlockLayouts,
selection: Option<Selection>,
dragging: bool,
window: &mut Window,
cx: &mut Context<'_, V>,
on_pointer: impl Fn(&mut V, Pointer, &mut Context<'_, V>) + 'static,
) -> AnyElementExpand description
Render doc with selection painted in it, reporting what the pointer does.
dragging is the caller’s: a move only extends a selection that a press
started, and which item that press landed in is not something one block of
text can know.
Releasing is answered twice over — on the text and off it — because a drag that ends past the edge of a paragraph is the ordinary way to select to the end of one.