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 2020/10/16 06:29:39 UTC

[incubator-echarts-examples] branch next updated: fix issues in useDirtyRect toggle

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

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


The following commit(s) were added to refs/heads/next by this push:
     new d7ef466  fix issues in useDirtyRect toggle
d7ef466 is described below

commit d7ef466a73e28a787d441327a41955db10bf5b7b
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Oct 16 14:29:09 2020 +0800

    fix issues in useDirtyRect toggle
---
 src/editor/sandbox.js       | 9 +++++++--
 src/explore/ExampleCard.vue | 3 +++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/editor/sandbox.js b/src/editor/sandbox.js
index 0821851..accf9dc 100644
--- a/src/editor/sandbox.js
+++ b/src/editor/sandbox.js
@@ -79,8 +79,13 @@ export function createSandbox(optionUpdated) {
                     renderer: store.renderer,
                     useDirtyRect: store.useDirtyRect
                 });
-                if (store.useDirtyRect) {
-                    showDebugDirtyRect(chartInstance.getZr());
+                if (store.useDirtyRect && store.renderer === 'canvas') {
+                    try {
+                        showDebugDirtyRect(chartInstance.getZr());
+                    }
+                    catch (e) {
+                        console.error(e);
+                    }
                 }
                 _wrapOnMethods(chartInstance);
             }
diff --git a/src/explore/ExampleCard.vue b/src/explore/ExampleCard.vue
index 8b09278..f1dfd8c 100644
--- a/src/explore/ExampleCard.vue
+++ b/src/explore/ExampleCard.vue
@@ -35,6 +35,9 @@ export default {
             if ('local' in URL_PARAMS) {
                 hash.push('local');
             }
+            if ('useDirtyRect' in URL_PARAMS) {
+                hash.push('useDirtyRect');
+            }
             return './editor.html?' + hash.join('&');
         },
 


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