afreakyelf / Pdf-Viewer

A Lightweight PDF Viewer Android library which only occupies around 80kb while most of the Pdf viewer occupies up to 16MB space.
https://afreakyelf.github.io/Pdf-Viewer/
MIT License
821 stars 173 forks source link

Fix x and y translation issue on double tap #149

Open bastionkid opened 3 months ago

bastionkid commented 3 months ago

Fixed the mPosX & mPosY values so that double tap to zoom does not cause the actual pdf bitmap to go out of screen bounds.

After applying the fix

https://github.com/user-attachments/assets/206b0e1c-f817-4204-8dd3-f77a13fa5921

VEZE commented 3 months ago

Right side of screen taps are not accurate, don't think it is fixed.

bastionkid commented 3 months ago

Right side of screen taps are not accurate, don't think it is fixed.

@VEZE Good observation. That was happening because of redundant clamping that was being applied. It is fixed in this commit.

After clamping removal

https://github.com/user-attachments/assets/206b0e1c-f817-4204-8dd3-f77a13fa5921

afreakyelf commented 3 months ago

Hey, this looks great. Did you test the behavior when you scroll while zoomed in? Mind posting the video?