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: [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]

Reply via email to