fix: axisLabel.height should work without backgroundColor (#21504)#21505
fix: axisLabel.height should work without backgroundColor (#21504)#21505SakshamSinghal20 wants to merge 2 commits intoapache:masterfrom
Conversation
|
Thanks for your contribution! Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only. To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: This message is shown because the PR description doesn't contain the document related template. |
|
@plainheart @100pah could you please review this at your convenience? |
|
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21505@a7194cc |
Ovilia
left a comment
There was a problem hiding this comment.
Please double check your test file. It shows nothing on my side. Make sure the test cases are created using npm run mktest axis-label-height-without-bg 3.
Please don't include FIX_SUMMARY.md.
The source code patch itself looks good to me. Thanks.
|
Hi @Ovilia I have done what you asked for let me know if there is anything that i need to do. |
| // 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'; | ||
| } |
There was a problem hiding this comment.
I don't believe this is the right way to fix the issue. As I mentioned earlier #21504 (comment), 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, or simply not fixing this "bug" at all, since there is already a simple workaround to avoid the problem.
Summary
Fixes axisLabel.height property to work independently of backgroundColor.
Changes
Fixes #21504