Skip to content
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

Fix alignment offset for selection in TextBox #1769

Merged
merged 1 commit into from
May 10, 2021

Conversation

CryZe
Copy link
Contributor

@CryZe CryZe commented May 9, 2021

The alignment offset was accidentally added instead of subtracted from the cursor position.

Fixes #1767

The alignment offset was accidentally added instead of subtracted from
the cursor position.
@CryZe
Copy link
Contributor Author

CryZe commented May 9, 2021

It might be wrong in more places such as cursor_line_for_text_position as well.

@cmyr cmyr self-requested a review May 10, 2021 13:02
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, I was quite confused by this but it looks like I broke it somewhere during the IME work.

cursor_line_for_text_position is fine; it's supposed to be the inverse operation (figuring out where to visually draw the cursor, for a given text position, as opposed to figuring out the text position for a cursor position).

Thanks!

@SecondFlight SecondFlight merged commit 1bd2245 into linebender:master May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Selection of centered text is wrongly positioned
3 participants