Skip to main content

tool_for

Function tool_for 

Source
pub fn tool_for(data: &Drawing<'_>, candidates: &[&Selection]) -> Tool
Expand description

The tool a restored selection resolves to — the one place that maps a selection back to the tool that holds it, so restoring and selecting cannot disagree about what “a block is selected” means.

candidates are tried in order and the first the document still holds wins; a step offers more than one because an undo can remove the thing its edit selected. None surviving means no selection, not a tool pointed at nothing.