Skip to content

Commit

Permalink
fix: attrs should be deep clone. Closed #288.
Browse files Browse the repository at this point in the history
  • Loading branch information
simaQ committed Sep 3, 2018
1 parent fa10b9f commit 2e4a90b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/animation/detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Chart = require('../chart/chart');

let timeline;
Element.prototype.animate = function() {
const attrs = this.get('attrs');
const attrs = Util.mix({}, this.get('attrs'));
return new Animator(this, attrs, timeline);
};

Expand Down
2 changes: 1 addition & 1 deletion src/animation/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Animator = require('../graphic/animate/animator');

let timeline;
Shape.prototype.animate = function() {
const attrs = this.get('attrs');
const attrs = Util.mix({}, this.get('attrs'));
return new Animator(this, attrs, timeline);
};

Expand Down
4 changes: 0 additions & 4 deletions test/bug/issue-302-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ canvas.height = 260;
canvas.id = 'issue302';
document.body.appendChild(canvas);

// function snapEqual(a, b) {
// return Math.abs(a - b) < 0.01;
// }

describe('issue 302', () => {
it('Issue 302', () => {
const data = [
Expand Down

0 comments on commit 2e4a90b

Please sign in to comment.