-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Text selection highlighting bugs #232
Comments
That's a known issue, except the part which crosses the screen on the left. It's to do with highlight_runs. As for tab stops, those are zero-width glyphs, thus there's nothing to highlight. Some workaround is needed. There's a similar problem with glyphs from a different script like Arabic; the selection rect height is wrong since the glyph height doesn't match the primary font's line height. |
I'd guess it's the same bug (or at least, bugs in the same rectangle generation logic). By the way, I don't consider fixing this a priority since most of the time it's usable enough, and fixing it properly will require more substantial changes to kas-text: (1) tab stops and the extra gaps between words used for justified text are not actual characters, (2) glyphs from different fonts may have different line heights at the same size, (3) bidirectional text support implies that the lexical start/end of a line isn't always at a (geometric) end of the line. That said, fixing at least some parts of this issue probably isn't so hard (e.g. merging selection rectangles where there is no other items between them). (In retrospect, I'm not sure whether supporting bidirectional text already was worth it: more bugs/complexity and I guess most early users don't care much for it. But it's there now.) |
kas-gui/kas-text#67 fixed an issue apparently not mentioned here: the vertical offset of highlights when text is vertically aligned. Other issues may or may not be fixed. The gaps in first/last line of justified text is definitely not. The highlight box escaping far to the left hopefully is. |
Text selection isn't rendered correctly when text is justified:
Or when it contains tab stops:
The text was updated successfully, but these errors were encountered: