Skip to content

fix: boundingRect.x of text is incorrect when overflow: 'truncate'. - #1100

Merged
plainheart merged 1 commit into
masterfrom
fix-text-truncate
Nov 20, 2024
Merged

plainheart merged 1 commit into
masterfrom
fix-text-truncate

Conversation

@100pah

@100pah 100pah commented Nov 16, 2024

Copy link
Copy Markdown
Contributor

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.
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