You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/06/21 02:27:22 UTC

[echarts] 02/02: fix(custom): fix decal not work in custom series

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch enhance-morph
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit e9d124cc67ca172263c02dd575161d274b10d4bf
Author: pissang <bm...@gmail.com>
AuthorDate: Sun Jun 20 23:23:06 2021 +0800

    fix(custom): fix decal not work in custom series
---
 src/chart/custom/CustomView.ts | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/chart/custom/CustomView.ts b/src/chart/custom/CustomView.ts
index 961a9ec..cd896e8 100644
--- a/src/chart/custom/CustomView.ts
+++ b/src/chart/custom/CustomView.ts
@@ -509,19 +509,13 @@ function applyPropsDirectly(
 
     if (elDisplayable && styleOpt) {
 
-        const decalPattern = (styleOpt as CustomZRPathOption['style']).__decalPattern;
-        let originalDecalObj;
-        if (decalPattern) {
-            originalDecalObj = (styleOpt as CustomZRPathOption['style']).decal;
-            (styleOpt as any).decal = decalPattern;
-        }
-
         // PENDING: here the input style object is used directly.
         // Good for performance but bad for compatibility control.
         elDisplayable.useStyle(styleOpt);
 
+        const decalPattern = (styleOpt as CustomZRPathOption['style']).__decalPattern;
         if (decalPattern) {
-            (styleOpt as CustomZRPathOption['style']).decal = originalDecalObj;
+            elDisplayable.style.decal = decalPattern;
         }
 
         // When style object changed, how to trade the existing animation?
@@ -548,8 +542,13 @@ function applyPropsDirectly(
         }
     }
 
-    // Set el to the final state firstly.
-    allPropsFinal && el.attr(allPropsFinal);
+    if (allPropsFinal) {
+        // Not set style here.
+        (allPropsFinal as DisplayableProps).style = null;
+        // Set el to the final state firstly.
+        allPropsFinal && el.attr(allPropsFinal);
+        (allPropsFinal as DisplayableProps).style = styleOpt;
+    }
 }
 
 function applyPropsTransition(

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