Skip to content

Commit 544c8d9

Browse files
kjaroshtorokati44
authored andcommitted
text: Take into account bounds in screen_position_to_index
1 parent 3e7effa commit 544c8d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/display_object/edit_text.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,6 +1329,8 @@ impl<'gc> EditText<'gc> {
13291329
let mut position = self.global_to_local(position)?;
13301330
position.x += Twips::from_pixels(text.hscroll) - Self::GUTTER;
13311331
position.y += text.vertical_scroll_offset() - Self::GUTTER;
1332+
position.x -= text.bounds.x_min;
1333+
position.y -= text.bounds.y_min;
13321334

13331335
// TODO We can use binary search for both y and x here
13341336

0 commit comments

Comments
 (0)