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 2020/06/02 09:01:35 UTC

[GitHub] [incubator-echarts] Ovilia commented on a change in pull request #12721: Fix #12708

Ovilia commented on a change in pull request #12721:
URL: https://github.com/apache/incubator-echarts/pull/12721#discussion_r433724164



##########
File path: src/chart/pie/labelLayout.js
##########
@@ -270,6 +272,22 @@ export default function (seriesModel, r, viewWidth, viewHeight, viewLeft, viewTo
             text, font, textAlign, 'top'
         );
 
+        // calculate after rich convert
+        var rich = labelModel.get('rich');
+        if (rich) {
+            var cloneRich = zrUtil.clone(rich);
+            Object.keys(cloneRich).forEach(key => {
+                const convertFont = getFont(cloneRich[key]);
+                cloneRich[key].font = convertFont;
+            });
+            var textParseRich = textContain.parseRichText(text, {
+                rich: cloneRich,
+                font: font
+            });
+            textRect.width = textParseRich.width;
+            textRect.height = textParseRich.height;

Review comment:
       Probably should use `outerWidth` and `outerHeight` instead.

##########
File path: src/chart/pie/labelLayout.js
##########
@@ -270,6 +272,22 @@ export default function (seriesModel, r, viewWidth, viewHeight, viewLeft, viewTo
             text, font, textAlign, 'top'
         );
 
+        // calculate after rich convert
+        var rich = labelModel.get('rich');
+        if (rich) {
+            var cloneRich = zrUtil.clone(rich);
+            Object.keys(cloneRich).forEach(key => {
+                const convertFont = getFont(cloneRich[key]);
+                cloneRich[key].font = convertFont;
+            });

Review comment:
       Use `rich: zrUtil.extend({}, rich)` instead.




----------------------------------------------------------------
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.

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