Recreate webtoon SSIV when crop borders setting changes (fixes #4734)
(cherry picked from commit 407e798fdbfb46f48f29aeb0c5930b8cd4415e28) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/webtoon/WebtoonPageHolder.kt
This commit is contained in:
parent
fb01b547de
commit
b2cf1266ba
@ -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,23 @@ class WebtoonPageHolder(
|
||||
* Initializes a subsampling scale view.
|
||||
*/
|
||||
private fun initSubsamplingImageView(): SubsamplingScaleImageView {
|
||||
if (subsamplingImageView != null) return subsamplingImageView!!
|
||||
|
||||
val config = viewer.config
|
||||
|
||||
// SY -->
|
||||
val imageCropBorders = if (!viewer.isContinuous) config.continuesCropBorders else config.imageCropBorders
|
||||
// SY <--
|
||||
if (subsamplingImageView != null && /* SY --> */ imageCropBorders /* SY <-- */ == cropBorders) {
|
||||
return subsamplingImageView!!
|
||||
}
|
||||
|
||||
cropBorders = /* SY --> */ imageCropBorders /* SY <-- */
|
||||
subsamplingImageView = WebtoonSubsamplingImageView(context).apply {
|
||||
setMaxTileSize(viewer.activity.maxBitmapSize)
|
||||
setPanLimit(SubsamplingScaleImageView.PAN_LIMIT_INSIDE)
|
||||
setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_FIT_WIDTH)
|
||||
setMinimumDpi(90)
|
||||
setMinimumTileDpi(180)
|
||||
setCropBorders(/* SY --> */ if (!viewer.isContinuous) config.continuesCropBorders else /* SY <-- */ config.imageCropBorders)
|
||||
setCropBorders(cropBorders)
|
||||
setOnImageEventListener(
|
||||
object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
|
||||
override fun onReady() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user