Conversation
…ct is inconsistent (contain stroke width or not) according to style.width & style.overflow (even if no wrapping or truncation happen and text is visually the same). This commit makes it consistent. (2) Previously, the bounding rect varies and unpredictable according to the internal auto-stroke application. This commit exclude auto-stroke width uniformly, since auto-stroke using the same color as background to make the border invisible. (3) deprecated `src/contain/text.ts` `getBoundingRect`, because it behave differently from Text#getBoundingRect, and unexpectedly when text contains "\n".
|
这是来自QQ邮箱的假期自动回复邮件。
您好,我已经收到你的邮件,我将仔细阅读来信,祝君身体健康,合家美满!
|
pissang
approved these changes
Jul 14, 2025
100pah
added a commit
to apache/echarts
that referenced
this pull request
Jul 15, 2025
…the inconsistent behavior in pie label layout - (2.1) Previously calling `getBoundingRect` before textConfig applied (causing the result diff). (2.2) Previously adding extra margin for "auto text stroke" even if no auto text stroke added. Currently use ecomfe/zrender#1134 to uniform the behavior.
3 tasks
Ovilia
approved these changes
Jul 18, 2025
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
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.
text bounding rect consistency
Previously, plain text bounding rect is inconsistent (contain stroke width or not) according to style.width & style.overflow (even if no wrapping or truncation happen and text is visually the same). This commit makes it consistent.
text bounding rect include stroke
Previously, the bounding rect varies and unpredictable according to the internal auto-stroke application:
style.width&style.overfloware specified, exclude stroke, otherwise include stroke.This commit exclude auto-stroke width uniformly, since auto-stroke using the same color as background to make the border invisible.
Should text bounding rect includes text stroke width?
Pathalways includes stroke width.0in this case to guarantee consistency of bounding rect based layout, regardless of whether "auto stroke" is applied.Deprecate
src/contain/text.tsgetBoundingRectUse

(new Text(...)).getBoundingRect()or(new TSpan(...)).getBoundingRect()instead.It behave differently from Text#getBoundingRect, and unexpectedly when text contains "\n".
The current effect:
The red border is the return of
contain/text.tsgetBoundingRect, but the blue border is the actual boundingRect if rendering by ZRText.PENDING
Should text bounding rect includes
style.padding,style.width,style.heightwhen NO background and border displayed? It depends on how to define that. HTMLgetBoundingClientRectcontain padding in that case. But currently ZRText does not.If implement that, an extra invisible Rect may need to be added as the placeholder for the bounding rect computation, considering animation of padding. But will it degrades performance for the most commonly used plain texts cases?