Skip to content

Fix alignment offset for selection in TextBox#1769

Merged
josh-audio merged 1 commit intolinebender:masterfrom
CryZe:fix-alignment-offset
May 10, 2021
Merged

Fix alignment offset for selection in TextBox#1769
josh-audio merged 1 commit intolinebender:masterfrom
CryZe:fix-alignment-offset

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!

@josh-audio josh-audio 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