Skip to content

Commit

Permalink
Merge pull request #16250 from apache/optimize-clone-divide
Browse files Browse the repository at this point in the history
Fix opacity wrong when using clone divideShape in universalTransition
  • Loading branch information
pissang authored Dec 20, 2021
2 parents a818387 + f499d42 commit c0df9ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/animation/universalTransition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// Universal transitions that can animate between any shapes(series) and any properties in any amounts.

import SeriesModel, { SERIES_UNIVERSAL_TRANSITION_PROP } from '../model/Series';
import {createHashMap, each, map, filter, isArray} from 'zrender/src/core/util';
import {createHashMap, each, map, filter, isArray, extend} from 'zrender/src/core/util';
import Element, { ElementAnimateConfig } from 'zrender/src/Element';
import { applyMorphAnimation, getPathList } from './morphTransitionHelper';
import Path from 'zrender/src/graphic/Path';
Expand Down Expand Up @@ -173,7 +173,11 @@ function transitionBetween(
) {
if (rawFrom || from) {
to.animateFrom({
style: (rawFrom || from).style
style: (rawFrom && rawFrom !== from)
// dividingMethod like clone may override the style(opacity)
// So extend it to raw style.
? extend(extend({}, rawFrom.style), from.style)
: from.style
}, animationCfg);
}
}
Expand Down

0 comments on commit c0df9ec

Please sign in to comment.