Skip to content

Commit

Permalink
maxVisibleCount
Browse files Browse the repository at this point in the history
  • Loading branch information
fanhl committed Jun 29, 2018
1 parent cc589a1 commit 6e0bbc2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/src/main/java/com/fanhl/flamebarchart/TravelChart.kt
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,6 @@ class TravelChart @JvmOverloads constructor(
val validWidth = width - paddingLeft - paddingRight
val validHeight = height - paddingTop - paddingBottom

maxVisibleCount = (validWidth + barInterval) / (barWidth + barInterval)

val saveCount = canvas.save()
canvas.translate(paddingLeft.toFloat(), paddingRight.toFloat())

Expand Down Expand Up @@ -840,6 +838,9 @@ class TravelChart @JvmOverloads constructor(

// Calling this with the present values causes it to re-claim them
scrollTo(mScrollX, 0)

val validWidth = width - paddingLeft - paddingRight
maxVisibleCount = (validWidth + barInterval) / (barWidth + barInterval)
}

override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
Expand Down

0 comments on commit 6e0bbc2

Please sign in to comment.