-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Feat/ignore host silent #1122
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
Merged
Merged
Feat/ignore host silent #1122
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…directional MTV, touchThreshold) to BoundingRect, enable them using the same option to perform intersection detection (for performance optimization). (2) Fix OBB result abnormal in some edge cases.
…and its host require specifying silent separately.
This was referenced Jun 2, 2025
100pah
added a commit
to apache/echarts
that referenced
this pull request
Jun 2, 2025
…t silent. It requires ecomfe/zrender#1122
…ified, the outerWidth use that specified width, rather than the contentWidth. After this modification, the behavior of plain text become consistent with plain text height and rich text width/height. And the rect text place will not be affected by the text content any more if style.width is specified. (2) Fix comment typos and add comments. (3) Add more test cases.
…r non-monospace font. BEFORE: shorter than the give width. AFTER: close to the given width). (2) Optimize the text truncate and wrap performance. (constantly visit LRU for each char from a long text is slower than using a static dictionary. In test/test-overflow.html, wrapping a entire long en text, each frame is optimize like from 15ms -> 4ms, in a certain machine).
…o avoid intersection.
…and copy it to local due to the instability of CDN
…culate the text.style.x/y/width/height, based on the host element boundingRect, as the overflow `break`/`breakAll`/`truncate` boundary. Previously it's difficult to calculate it externally due to the numerous props in textConfig and text.style and internal processing.
Ovilia
approved these changes
Jun 9, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support
ignoreHostSilentSupport
ignoreHostSilentfor some scenarios that textContent and its host require specifying silent separately.By default the a textContent follows the silent of its ancestors or
__hostTargetissilent: fasle, regardless of its ownsilentsetting.But they may need separate silent settings.
e.g., the host do not have
fillbut onlystroke, or their mouse events serve for different features.This PR introduce a new config
ignoreHostSilentto convey that meaning.The case is in apache/echarts#21005 ,
test/matrix3.html:The cell text may overflow and truncated. The tooltip are needed for display the entire text, but the cell rect (border or background) may not be appropriate to trigger that tooltip (may bother users).
Fix lineOverflow content height
lineOverflow need to update contentHeight.
Otherwise the textContent layout is incorrect if
textConfig.position: 'top'for long text.Clarify plain text parsing
If text.style.width specified, the outerWidth use that specified width, rather than the contentWidth. After this modification, the behavior of plain text become consistent with plain text height and rich text width/height. And the rect text place will not be affected by the text content any more if style.width is specified.
Make text overflow truncate more precise
consider non-monospace font.
BEFORE: shorter than the give width.
Before: (text.style.padding: 10)

AFTER: close to the given width.
After: (text.style.padding: 10)

After: (text.style.padding: 0)

Optimize the text truncate and wrap performance.
Constantly visit LRU for each char from a long text is slower than using a static dictionary.
test case:
test/test-overflow.htmlOn a certain device, wrapping a entire long en text.
BEFORE:

Constantly change text.style.width:
First render time is approximately 30 ms.
AFTER:

Constantly change text.style.width:
First render time is approximately 20 ms.
Support textConfig.autoOverflowArea
textConfig.autoOverflowAreaauto calculate the text.style.x/y/width/height, based on the host element boundingRect, as the overflow break/breakAll/truncate boundary. Previously it's difficult to calculate it externally due to the numerous props in textConfig and text.style and internal processing.BoundingRect and OrientedBoundingRect