Skip to content

Commit

Permalink
Fix double tap zoom doesn't work issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
keiji committed Sep 10, 2020
1 parent 88abf67 commit d006feb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class DoubleTapZoomHelper(
companion object {
private val TAG = DoubleTapZoomHelper::class.java.simpleName

private const val DELTA = 0.001F
private const val DEFAULT_DOUBLE_TAP_SCALE = 4.0F
}

Expand Down Expand Up @@ -44,7 +45,7 @@ class DoubleTapZoomHelper(
private fun doubleTapZoom(mangaView: MangaView, x: Float, y: Float): Boolean {
val viewContext = mangaView.viewContext

if (viewContext.currentScale >= maxScale) {
if ((maxScale - viewContext.currentScale) < DELTA) {
mangaView.scale(viewContext.minScale, x, y, smoothScale = true)
} else {
mangaView.scale(maxScale, x, y, smoothScale = true)
Expand Down

0 comments on commit d006feb

Please sign in to comment.