diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt index ca124c2f5..7a64b5aef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt @@ -66,6 +66,7 @@ class WebtoonPageHolder( * Image view that supports subsampling on zoom. */ private var subsamplingImageView: SubsamplingScaleImageView? = null + private var cropBorders: Boolean = false /** * Simple image view only used on GIFs. @@ -360,17 +361,20 @@ class WebtoonPageHolder( * Initializes a subsampling scale view. */ private fun initSubsamplingImageView(): SubsamplingScaleImageView { - if (subsamplingImageView != null) return subsamplingImageView!! - val config = viewer.config + if (subsamplingImageView != null && config.imageCropBorders == cropBorders) { + return subsamplingImageView!! + } + + cropBorders = config.imageCropBorders subsamplingImageView = WebtoonSubsamplingImageView(context).apply { setMaxTileSize(viewer.activity.maxBitmapSize) setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_INSIDE) setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_FIT_WIDTH) setMinimumDpi(90) setMinimumTileDpi(180) - setCropBorders(config.imageCropBorders) + setCropBorders(cropBorders) setOnImageEventListener( object : SubsamplingScaleImageView.DefaultOnImageEventListener() { override fun onReady() {