Skip to content

Commit

Permalink
Fixes fill animation path
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Mace committed Mar 21, 2018
1 parent 0e47f62 commit 6b99d26
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spark/src/main/java/com/robinhood/spark/SparkView.java
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,12 @@ public Path getSparkLinePath() {
* Set the path to animate in onDraw, used for getAnimation purposes
*/
public void setAnimationPath(final Path animationPath) {
float fillY = getFillEdge() != null ? getFillEdge() : 0;

this.renderPath.reset();
this.renderPath.addPath(animationPath);
this.renderPath.rLineTo(0, 0);
this.renderPath.rLineTo(0, fillType == FillType.UP ? -getHeight(): fillY);
this.renderPath.lineTo(0, fillY);

invalidate();
}
Expand Down

0 comments on commit 6b99d26

Please sign in to comment.