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 <sushuang0...@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-unsubscr...@echarts.apache.org For additional commands, e-mail: commits-h...@echarts.apache.org