Skip to content

Commit

Permalink
fixed #427 markLine resize animation transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
kener committed Jul 22, 2014
1 parent 09321ce commit e897bf7
Showing 1 changed file with 34 additions and 38 deletions.
72 changes: 34 additions & 38 deletions src/util/ecAnimation.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,49 +485,45 @@ define(function (require) {
* @param {tring} easing
*/
function markline(zr, oldShape, newShape, duration, easing) {
if (!oldShape) { // add
if (!newShape.style.smooth) {
newShape.style.pointList = [
if (!newShape.style.smooth) {
newShape.style.pointList = !oldShape
? [
[newShape.style.xStart, newShape.style.yStart],
[newShape.style.xStart, newShape.style.yStart]
];
zr.addShape(newShape);
zr.animate(newShape.id, 'style')
.when(
duration,
{
pointList : [
[
newShape.style.xStart,
newShape.style.yStart
],
[
newShape._x || 0, newShape._y || 0
]
]
: oldShape.style.pointList;
zr.addShape(newShape);
zr.animate(newShape.id, 'style')
.when(
duration,
{
pointList : [
[
newShape.style.xStart,
newShape.style.yStart
],
[
newShape._x || 0, newShape._y || 0
]
}
)
.start(easing || 'QuinticOut');
}
else {
// 曲线动画
newShape.style.pointListLength = 1;
zr.addShape(newShape);
newShape.style.pointList = newShape.style.pointList
|| newShape.getPointList(newShape.style);
zr.animate(newShape.id, 'style')
.when(
duration,
{
pointListLength : newShape.style.pointList.length
}
)
.start(easing || 'QuinticOut');
}
]
}
)
.start(easing || 'QuinticOut');
}
else {
// mod
line(zr, oldShape, newShape, duration, easing);
// 曲线动画
newShape.style.pointListLength = 1;
zr.addShape(newShape);
newShape.style.pointList = newShape.style.pointList
|| newShape.getPointList(newShape.style);
zr.animate(newShape.id, 'style')
.when(
duration,
{
pointListLength : newShape.style.pointList.length
}
)
.start(easing || 'QuinticOut');
}
}

Expand Down

0 comments on commit e897bf7

Please sign in to comment.