-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avm2: Make TextField.getCharIndexAtPoint
accurate
#18861
base: master
Are you sure you want to change the base?
Conversation
7398312
to
796f2e8
Compare
@@ -2109,6 +2109,38 @@ impl<'gc> EditText<'gc> { | |||
) | |||
} | |||
|
|||
pub fn char_index_at_point(self, position: Point<Twips>) -> Option<usize> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please add some docstrings to better distinguish this from screen_position_to_index
? From just signature and used coordinate space they sound super similar, but name style and implementation are super different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
796f2e8
to
0bf3e99
Compare
This patch fixes getCharIndexAtPoint() so that it's accurate for all inputs.
This test verifies the behavior of getCharIndexAtPoint().
0bf3e99
to
2e5ff5d
Compare
getCharBoundaries()
for 0-width characters #18860This patch fixes
getCharIndexAtPoint()
so that it's accurate for all inputs.