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: boundingRect.x of text is incorrect when overflow: 'truncate'. #1100

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

100pah
Copy link
Contributor

@100pah 100pah commented Nov 16, 2024

Details

Current behavior: Hovering mouse over an axis label should have a click target that is aligned with the axis label text. Click target is where mouse pointer is hovering in the screenshot.

This PR fix it.

Original bug issue: apache/echarts#18306 .
And #1091 located the problematic code successfully (thanks @linghaoSu , it's helpful). But the fix was not entirely correct.

Memo info: This code used to be modified in commits bd2642e and bd2642e , where the boundingRect.width was modified from style.width to innerWith and then outerWith, but the boundingRect.x was not modified correspondingly.

Reproduce & Test case

zrender/test/text-overflow.html

Set in the config panel:

  • overflow: 'truncate'
  • align: 'center'
  • uncheck rich
  • hover mouse on the text "abcde", check whether the mouse pointer style changes in correct place.

…lose apache/echarts#18306 . And #1091 located the problematic code successfully but the fix was not entirely correct.
@plainheart plainheart merged commit 4055b18 into master Nov 20, 2024
3 checks passed
@plainheart plainheart deleted the fix-text-truncate branch November 20, 2024 13:07
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.

[Bug] Overflow truncate breaks axis label click target position
2 participants