fn map_chars_index_to_position(&self, ctx: &mut Context) -> Vec<(usize, f64)> {
        let len = self.len(ctx);

        // start x position of the cursor is start position of the text element + padding left
        let start_position: f64 = ctx.widget().get::<Point>("position").x()
            + ctx.get_widget(self.target).get::<Thickness>("padding").left
            + *TextBlock::offset_ref(&ctx.get_widget(self.text_block));

        // array which will hold char index and it's x position
        let mut position_index: Vec<(usize, f64)> = Vec::with_capacity(len);
        position_index.push((0, start_position));

        for i in 0..len {
            let bound_width: f64 = self.measure(ctx, 0, i + 1).width;

            let next_position: f64 = start_position + bound_width;

            position_index.push((i + 1, next_position));
        }

        position_index
    }
// Returns a vector with a tuple of each char's starting index (usize) and position (f64)
Returns a vector with a tuple of each char's starting index (usize) and position (f64)
Returns a vector with a tuple of each char ' s starting index ( usize ) and position ( f64 )
fn map_chars_index_to_position(&self, ctx: &mut Context) -> Vec<(usize, f64)> {
        let len = self.len(ctx);
        // start x position of the cursor is start position of the text element + padding left
        let start_position: f64 = ctx.widget().get::<Point>("position").x()
            + ctx.get_widget(self.target).get::<Thickness>("padding").left
            + *TextBlock::offset_ref(&ctx.get_widget(self.text_block));
        // array which will hold char index and it's x position
        let mut position_index: Vec<(usize, f64)> = Vec::with_capacity(len);
        position_index.push((0, start_position));
        for i in 0..len {
            let bound_width: f64 = self.measure(ctx, 0, i + 1).width;
            let next_position: f64 = start_position + bound_width;
            position_index.push((i + 1, next_position));
        }
        position_index
    }
fn map_chars_index_to_position ( & self , ctx : & mut Context ) -> Vec < ( usize , f64 ) > { let len = self . len ( ctx ) ; // start x position of the cursor is start position of the text element + padding left let start_position : f64 = ctx . widget ( ) . get :: < Point > ( " " ) . x ( ) + ctx . get_widget ( self . target ) . get :: < Thickness > ( " " ) . left + * TextBlock :: offset_ref ( & ctx . get_widget ( self . text_block ) ) ; // array which will hold char index and it's x position let mut position_index : Vec < ( usize , f64 ) > = Vec :: with_capacity ( len ) ; position_index . push ( ( 0 , start_position ) ) ; for i in 0 .. len { let bound_width : f64 = self . measure ( ctx , 0 , i + 1 ) . width ; let next_position : f64 = start_position + bound_width ; position_index . push ( ( i + 1 , next_position ) ) ; } position_index }
Returns a vector with a tuple of each char's starting index (usize) and position (f64)
Returns a vector with a tuple of each char ' s starting index ( usize ) and position ( f64 )
&self
ctx
&mut Context