You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/02/18 11:39:19 UTC

[GitHub] [echarts] tudou330121 opened a new pull request #16540: fix the icon of legend is overflow.When the selector option is turned on

tudou330121 opened a new pull request #16540:
URL: https://github.com/apache/echarts/pull/16540


   … turned on
   
   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [x] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   1.run test case: legend.html
   2.check the code is right
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   https://github.com/apache/echarts/issues/16451
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   
   
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   <img width="428" alt="image" src="https://user-images.githubusercontent.com/30098601/154674702-299d3727-8604-4c24-a766-b10e2d3972fd.png">
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   the icon of legend is overflow.When the selector option is turned on
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   <img width="475" alt="image" src="https://user-images.githubusercontent.com/30098601/154674897-311c3a8b-8943-44ce-a088-ed4dab12e3b9.png">
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   ## Misc
   
   <!-- ADD RELATED ISSUE ID WHEN APPLICABLE -->
   
   - [ ] The API has been changed (apache/echarts-doc#xxx).
   - [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
   
   ### Related test cases or examples to use the new APIs
   
   N.A.
   
   
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merging.
   
   ### Other information
   


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] echarts-bot[bot] commented on pull request #16540: fix the icon of legend is overflow.When the selector option is turned on

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #16540:
URL: https://github.com/apache/echarts/pull/16540#issuecomment-1044382618


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).


-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[GitHub] [echarts] pissang commented on a change in pull request #16540: fix the icon of legend is overflow.When the selector option is turned on

Posted by GitBox <gi...@apache.org>.
pissang commented on a change in pull request #16540:
URL: https://github.com/apache/echarts/pull/16540#discussion_r809980295



##########
File path: src/component/legend/LegendView.ts
##########
@@ -467,6 +467,14 @@ class LegendView extends ComponentView {
         const contentGroup = this.getContentGroup();
         const selectorGroup = this.getSelectorGroup();
 
+        const selectorButtonGap = legendModel.get('selectorButtonGap', true);
+        if (selector && legendModel.get('orient') === 'horizontal') {

Review comment:
       It's better to cache the `legendModel.get('orient')` in a temporary variable

##########
File path: src/util/layout.ts
##########
@@ -84,7 +84,7 @@ function boxLayout(
             nextX = x + moveX;
             // Wrap when width exceeds maxWidth or meet a `newline` group
             // FIXME compare before adding gap?
-            if (nextX > maxWidth || (child as NewlineElement).newline) {
+            if (nextX > maxWidth || (child as NewlineElement).newline || (nextX + rect.width > maxWidth)) {

Review comment:
       `next.x` already includes `rect.width`




-- 
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: commits-unsubscribe@echarts.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org