Fix tap control area shifting after zooming out (#767)

This commit is contained in:
FooIbar 2024-05-07 17:13:43 +08:00 committed by Cuong Tran
parent dc2dd3dc58
commit 05b349c508
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
2 changed files with 3 additions and 2 deletions

View file

@ -28,7 +28,8 @@ class WebtoonRecyclerView @JvmOverloads constructor(
private var atFirstPosition = false
private var halfWidth = 0
private var halfHeight = 0
private var originalHeight = 0
var originalHeight = 0
private set
private var heightSet = false
private var firstVisibleItemPosition = 0
private var lastVisibleItemPosition = 0

View file

@ -124,7 +124,7 @@ class WebtoonViewer(
recycler.getLocationInWindow(viewPositionRelativeToWindow)
val pos = PointF(
(event.rawX - viewPosition[0] + viewPositionRelativeToWindow[0]) / recycler.width,
(event.rawY - viewPosition[1] + viewPositionRelativeToWindow[1]) / recycler.height,
(event.rawY - viewPosition[1] + viewPositionRelativeToWindow[1]) / recycler.originalHeight,
)
when (config.navigator.getAction(pos)) {
NavigationRegion.MENU -> activity.toggleMenu()