Skip to content

Commit

Permalink
fix: slider precision crash on Nexus4 (#87)
Browse files Browse the repository at this point in the history
Closes #81
  • Loading branch information
sdsantos authored May 25, 2020
1 parent 4cefc09 commit 5465f34
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class StorageSlider
step = StorageSize(stepSize.toLong() * RESOLUTION)
)
set(value) {
valueFrom = value.steppedMin.bytes.toFloat() / RESOLUTION
valueTo = value.steppedMax.bytes.toFloat() / RESOLUTION
stepSize = value.step.bytes.toFloat() / RESOLUTION
valueFrom = (value.steppedMin.bytes / RESOLUTION).toFloat()
valueTo = (value.steppedMax.bytes / RESOLUTION).toFloat()
stepSize = (value.step.bytes / RESOLUTION).toFloat()
resetSize()
}

Expand All @@ -43,6 +43,6 @@ class StorageSlider
}

companion object {
private const val RESOLUTION = 1_000_000
private const val RESOLUTION = 1_000_000L
}
}

0 comments on commit 5465f34

Please sign in to comment.