Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting cornerRadius to non-zero results in fill closing path also using radius #66

Open
cammace opened this issue Apr 25, 2018 · 1 comment

Comments

@cammace
Copy link
Contributor

cammace commented Apr 25, 2018

When we set cornerRadius to a non-zero value, CornerPathEffect is applied which works great until you apply a fill to the graph which results in:

I think rather than closing the path, if a fill is applied, on line 274 we should manually enclose the path first by hitting the bottom right corner of the view, then bottom left, and finally back to the starting position. I'm also wondering if we could make this paticuliar closing path "invisible" rather than showing the sparkline path closing the graph.

@danh32
Copy link
Contributor

danh32 commented May 1, 2018

Oh wow, haha! What cornerRadius did you set?

I have:

    <com.robinhood.spark.SparkView
        android:id="@+id/sparkview"
        android:layout_width="match_parent"
        android:layout_height="200dp"
        app:spark_lineColor="@color/colorAccent"
        app:spark_fillColor="@color/colorAccentTransparent"
        app:spark_fillType="down"
        app:spark_cornerRadius="15dp"
        app:spark_scrubEnabled="true"/>

and am seeing:

screen shot 2018-05-01 at 9 20 14 am

Interestingly, we're already manually enclosing the path by going to the bottom right then bottom left. The close() call only closes from the bottom left back to the first point in the spark. I don't have any immediate ideas on how to fix this, but mostly because I think the solution will be different for different applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants