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

Closing path should be to zero value not to the bottom #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -488,13 +488,14 @@ public void draw(GraphView graphView, Canvas canvas, boolean isSecondScale) {
}

if (mStyles.drawBackground && firstX != -1) {
float zero = (float) (graphHeight + graphTop + minY / diffY * graphHeight);
// end / close path
if (lastUsedEndY != graphHeight + graphTop) {
if (lastUsedEndY != zero) {
// dont draw line to same point, otherwise the path is completely broken
mPathBackground.lineTo((float) lastUsedEndX, graphHeight + graphTop);
mPathBackground.lineTo((float) lastUsedEndX, zero);
}
mPathBackground.lineTo(firstX, graphHeight + graphTop);
if (firstY != graphHeight + graphTop) {
mPathBackground.lineTo(firstX, zero);
if (firstY != zero) {
// dont draw line to same point, otherwise the path is completely broken
mPathBackground.lineTo(firstX, firstY);
}
Expand Down