Skip to content

Fix Chinese text selection#2790

Merged
vadi2 merged 11 commits intoMudlet:developmentfrom
vadi2:fix-chinese-text-selection
Jul 18, 2019
Merged

Fix Chinese text selection#2790
vadi2 merged 11 commits intoMudlet:developmentfrom
vadi2:fix-chinese-text-selection

Conversation

@vadi2
Copy link
Copy Markdown
Member

@vadi2 vadi2 commented Jul 17, 2019

Brief overview of PR changes/additions

Before:
before

After:
after

Motivation for adding to Mudlet

i18n goals, fix #1825.

Other info (issues closed, discussion etc)

I'm not entirely happy with the new function naming - ideas welcome... the important method is convertMouseXToBufferX() which dynamically calculates the actual character index instead of assuming all characters are width 1 as before.

Things to test:

  • ASCII (English) text selection
  • clickable menus made via Lua
  • MXP menus from the game

@vadi2 vadi2 added this to the 3.23.0 milestone Jul 17, 2019
@vadi2 vadi2 requested a review from a team as a code owner July 17, 2019 09:02
@vadi2 vadi2 requested a review from a team July 17, 2019 09:02
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jul 17, 2019

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@vadi2 vadi2 changed the title Fix Chinese, tab, Unicode text selection Fix Chinese and tab text selection Jul 17, 2019
@vadi2 vadi2 changed the title Fix Chinese and tab text selection Fix Chinese text selection Jul 18, 2019
@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 18, 2019

Chinese selection works fine, tab selection does not - upon inspection current display of tabs in Mudlet is even more broken than before. Compare:

image

Mudlet:

image

I'll look into tab display and selection in another PR, as that's an entire subject of its own.

@vadi2
Copy link
Copy Markdown
Member Author

vadi2 commented Jul 18, 2019

Feedback is positive from two users so far:

@Vadi i checked this version again, it's better then the version yesterday..i can select the chinese text pretty exactly

LGTM

Tab selection doesn't work right, but that is a separate issue as tab display itself doesn't even work right.

Copy link
Copy Markdown
Contributor

@Kebap Kebap left a comment

Choose a reason for hiding this comment

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

Looks Good To Me
Let's Get This Merged

@vadi2 vadi2 merged commit b3f3761 into Mudlet:development Jul 18, 2019
@vadi2 vadi2 deleted the fix-chinese-text-selection branch July 18, 2019 11:38
@vadi2 vadi2 modified the milestones: 3.23.0, 4.0.0 Jul 21, 2019
int x = event->x() / mFontWidth;
if (mShowTimeStamps) {
if (x < 13) {
mCtrlSelecting = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Removing this line of code(and the conditional path to it) is presumably what broke timestamp selection. Probably could be re-implemented pretty easily.

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.

Text highlight of wide characters (i.e. chinese) doesn't select right

4 participants