You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by su...@apache.org on 2020/11/08 14:07:33 UTC

[incubator-echarts] branch fix/pictorial-hover created (now 8de0e3e)

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

sushuang pushed a change to branch fix/pictorial-hover
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git.


      at 8de0e3e  fix: pictorialBar by default do not "hoverAnimation".

This branch includes the following new commits:

     new 8de0e3e  fix: pictorialBar by default do not "hoverAnimation".

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-echarts] 01/01: fix: pictorialBar by default do not "hoverAnimation".

Posted by su...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sushuang pushed a commit to branch fix/pictorial-hover
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git

commit 8de0e3ee1040f1d877be03abc87efe07c131f37a
Author: 100pah <su...@gmail.com>
AuthorDate: Sun Nov 8 22:04:40 2020 +0800

    fix: pictorialBar by default do not "hoverAnimation".
---
 src/chart/bar/PictorialBarSeries.ts |  2 ++
 src/chart/bar/PictorialBarView.ts   | 10 +++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/chart/bar/PictorialBarSeries.ts b/src/chart/bar/PictorialBarSeries.ts
index 209f51e..f24a8ac 100644
--- a/src/chart/bar/PictorialBarSeries.ts
+++ b/src/chart/bar/PictorialBarSeries.ts
@@ -157,6 +157,8 @@ class PictorialBarSeriesModel extends BaseBarSeriesModel<PictorialBarSeriesOptio
         progressive: 0,
 
         emphasis: {
+            // By default pictorialBar do not hover scale. Hover scale is not suitable
+            // for the case that both has foreground and background.
             scale: false
         },
 
diff --git a/src/chart/bar/PictorialBarView.ts b/src/chart/bar/PictorialBarView.ts
index e926232..ae49c30 100644
--- a/src/chart/bar/PictorialBarView.ts
+++ b/src/chart/bar/PictorialBarView.ts
@@ -888,6 +888,7 @@ function updateCommon(
 
     const focus = emphasisModel.get('focus');
     const blurScope = emphasisModel.get('blurScope');
+    const hoverScale = emphasisModel.get('scale');
 
     eachPath(bar, function (path) {
         if (path instanceof ZRImage) {
@@ -905,9 +906,12 @@ function updateCommon(
 
         const emphasisState = path.ensureState('emphasis');
         emphasisState.style = emphasisStyle;
-        // NOTE: Must after scale is set after updateAttr
-        emphasisState.scaleX = path.scaleX * 1.1;
-        emphasisState.scaleY = path.scaleY * 1.1;
+
+        if (hoverScale) {
+            // NOTE: Must after scale is set after updateAttr
+            emphasisState.scaleX = path.scaleX * 1.1;
+            emphasisState.scaleY = path.scaleY * 1.1;
+        }
 
         path.ensureState('blur').style = blurStyle;
         path.ensureState('select').style = selectStyle;


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