fix: occasionally the scroll end does not reach to the last subpixel (#284)

This commit is contained in:
Huang Xin
2025-02-01 17:54:11 +01:00
committed by GitHub
parent 4d7db3592f
commit 5c55233c5c
@@ -86,7 +86,8 @@ const FoliateViewer: React.FC<{
if (renderer) {
if (renderer.start <= 0) {
viewRef.current?.prev(1);
} else if (renderer.end >= renderer.viewSize) {
// sometimes viewSize has subpixel value that the end never reaches
} else if (renderer.end + 1 >= renderer.viewSize) {
viewRef.current?.next(1);
}
}