Skip to main content

get_offset_for_position

Function get_offset_for_position 

Source
pub fn get_offset_for_position(text: &str, x: f32, y: f32) -> usize
Expand description

Returns byte offset in text for given x position. Used for cursor positioning on click.