plainheart commented on code in PR #21505:
URL: https://github.com/apache/echarts/pull/21505#discussion_r2780917863
##########
src/label/labelStyle.ts:
##########
@@ -682,6 +682,11 @@ function setTokenTextStyle<TNuance extends
TextCommonOptionNuanceBase>(
textStyle.borderColor = inheritColor;
}
}
+ // If height or width is set but no backgroundColor, set transparent
background
+ // to ensure the box constraints are applied
+ if ((textStyle.height != null || textStyle.width != null) &&
textStyle.backgroundColor == null) {
+ textStyle.backgroundColor = 'transparent';
+ }
Review Comment:
I don't believe this is the right way to fix the issue. As I mentioned
earlier https://github.com/apache/echarts/issues/21504#issuecomment-3823209613,
this behavior is likely intentional by design, but it did not account for cases
where the text has explicit width, height, or padding. In such situations, the
text background box should still be drawn, even when no background color is
specified.
I would suggest either implementing the fix at the underlying
[ZRender](https://github.com/ecomfe/zrender/blob/6.0.0/src/graphic/Text.ts), or
simply not fixing this "bug" at all, since there is already a simple workaround
to avoid the problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]