From 02ea804874d00bc175fcb1abdc1e2dd5d4842242 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 17:52:33 +0000 Subject: [PATCH] Fix(reader): Fix incorrect scaling for short images in webtoon reader When an image in the webtoon reader is shorter than the screen height, it was being incorrectly scaled, causing it to appear zoomed in or cropped. This was caused by the `scrollTo` function in `WebtoonImageView.kt` calling `resetScaleAndCenter()` for images with a scroll range of zero. This method, from the underlying SubsamplingScaleImageView library, resets the image to a default scale instead of using the custom logic required by the reader. The fix replaces the call to `resetScaleAndCenter()` with `scrollToInternal(0)`. This ensures that the custom scaling logic, which fits the image to the screen width, is applied consistently to all images, regardless of their height. --- .../kotatsu/reader/ui/pager/webtoon/WebtoonImageView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/webtoon/WebtoonImageView.kt b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/webtoon/WebtoonImageView.kt index cd26a83f7..412b1a4fe 100644 --- a/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/webtoon/WebtoonImageView.kt +++ b/app/src/main/kotlin/org/koitharu/kotatsu/reader/ui/pager/webtoon/WebtoonImageView.kt @@ -40,7 +40,7 @@ class WebtoonImageView @JvmOverloads constructor( fun scrollTo(y: Int) { val maxScroll = getScrollRange() if (maxScroll == 0) { - resetScaleAndCenter() + scrollToInternal(0) return } scrollToInternal(y.coerceIn(0, maxScroll))