Skip to content

Commit fd1bce3

Browse files
Merge pull request #103 from mtotschnig/101-ZeroValues
Filter lines with amount 0 during onDraw
2 parents cd9d76e + 9d4f839 commit fd1bce3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/main/kotlin/app/futured/donut/DonutProgressView.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class DonutProgressView @JvmOverloads constructor(
260260
assertDataConsistency(sections)
261261

262262
sections
263-
.filter { it.amount > 0f }
263+
.filter { it.amount >= 0f }
264264
.forEach { section ->
265265
val newLineColor = section.color
266266
if (hasEntriesForSection(section.name).not()) {
@@ -487,7 +487,7 @@ class DonutProgressView @JvmOverloads constructor(
487487
canvas.translate(centerX, centerY)
488488

489489
bgLine.draw(canvas)
490-
lines.forEach { it.draw(canvas) }
490+
lines.filter { it.mLength > 0f } .forEach { it.draw(canvas) }
491491
}
492492

493493
private fun dpToPx(dp: Float) = TypedValue.applyDimension(

0 commit comments

Comments
 (0)