Skip to content

Commit

Permalink
text: Add doc to line_index_at_point
Browse files Browse the repository at this point in the history
  • Loading branch information
kjarosh committed Dec 12, 2024
1 parent 9f9d671 commit 699a06d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/display_object/edit_text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,11 @@ impl<'gc> EditText<'gc> {
Some(first_box.start())
}

/// Returns the index of the line that is at the given position.
///
/// It returns `None` when there's no line at the given position,
/// with the exception that positions below the last line will
/// return the index of the last line.
pub fn line_index_at_point(self, position: Point<Twips>) -> Option<usize> {
let edit_text = self.0.read();

Expand Down

0 comments on commit 699a06d

Please sign in to comment.