Skip to content

Commit

Permalink
Fix x and y translation issue on double tap
Browse files Browse the repository at this point in the history
  • Loading branch information
bastionkid committed Aug 3, 2024
1 parent 4ae7b12 commit 9839e3d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ class PinchZoomRecyclerView : RecyclerView {
mScaleFactor = targetScale

// Adjust position so that it scales towards the double-tap location
mPosX -= (e.x - mPosX) * (1 - scaleDelta)
mPosY -= (e.y - mPosY) * (1 - scaleDelta)
mPosX -= (e.x - mPosX) * (scaleDelta - 1)
mPosY -= (e.y - mPosY) * (scaleDelta - 1)

clampPosition()
}
Expand Down

0 comments on commit 9839e3d

Please sign in to comment.