Skip to content

Commit

Permalink
fix: hidden point draw error.
Browse files Browse the repository at this point in the history
  • Loading branch information
simaQ committed Mar 5, 2018
1 parent 6c9efc8 commit 06bdef1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
8 changes: 5 additions & 3 deletions src/geom/area.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ class Area extends Geom {
});
cfg.points = points;
const gShape = shapeFactory.drawShape(cfg.shape, cfg, container);
Util.each([].concat(gShape), s => {
s.set('origin', data[0]); // todo
});
if (gShape) {
Util.each([].concat(gShape), s => {
s.set('origin', data[0]); // todo
});
}
});
}
}
Expand Down
8 changes: 5 additions & 3 deletions src/geom/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,11 @@ class Geom extends Base {
const cfg = self.getDrawCfg(obj);
const shape = obj.shape;
const gShape = shapeFactory.drawShape(shape, cfg, container);
Util.each([].concat(gShape), s => {
s.set('origin', obj); // todo
});
if (gShape) {
Util.each([].concat(gShape), s => {
s.set('origin', obj); // todo
});
}
});
}

Expand Down
8 changes: 5 additions & 3 deletions src/geom/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ class Path extends Geom {
cfg.splitedIndex = splitedIndex; // 浼犲叆鍒嗗壊鐗囨绱㈠紩 鐢ㄤ簬鐢熸垚id
cfg.points = subData;
const gShape = shapeFactory.drawShape(cfg.shape, cfg, container);
Util.each([].concat(gShape), s => {
s.set('origin', data[0]); // todo
});
if (gShape) {
Util.each([].concat(gShape), s => {
s.set('origin', data[0]); // todo
});
}
});
}
}
Expand Down
14 changes: 10 additions & 4 deletions src/graphic/animate/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ class Timeline {
const duration = propertyAnim.endTime - propertyAnim.startTime;
let t = duration ? (this.time - propertyAnim.startTime) / (duration) : 1;
t = Math.max(0, Math.min(t, 1));

if (t === 1) {
this.anims.splice(i, 1);
i--;
}

t = propertyAnim.easing(t);

const value = diff(t);
Expand Down Expand Up @@ -105,10 +111,10 @@ class Timeline {
}
}

if (t === 1) {
this.anims.splice(i, 1);
i--;
}
// if (t === 1) {
// this.anims.splice(i, 1);
// i--;
// }
}
}
}
Expand Down

0 comments on commit 06bdef1

Please sign in to comment.