From 6b99d264ac31463dc247bf4ec7fd4e309b821130 Mon Sep 17 00:00:00 2001 From: Cameron Mace Date: Wed, 21 Mar 2018 14:56:21 -0400 Subject: [PATCH] Fixes fill animation path --- spark/src/main/java/com/robinhood/spark/SparkView.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spark/src/main/java/com/robinhood/spark/SparkView.java b/spark/src/main/java/com/robinhood/spark/SparkView.java index 4a92c0d..e892422 100644 --- a/spark/src/main/java/com/robinhood/spark/SparkView.java +++ b/spark/src/main/java/com/robinhood/spark/SparkView.java @@ -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(); }