mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 12:41:50 +01:00
Fix webtoon view not updating on crop border change
Co-Authored-By: arkon <4098258+arkon@users.noreply.github.com>
This commit is contained in:
parent
d36c6f501e
commit
b42fa19867
@ -64,6 +64,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.
|
||||
@ -349,9 +350,18 @@ class WebtoonPageHolder(
|
||||
* Initializes a subsampling scale view.
|
||||
*/
|
||||
private fun initSubsamplingImageView(): SubsamplingScaleImageView {
|
||||
if (subsamplingImageView != null) return subsamplingImageView!!
|
||||
|
||||
val config = viewer.config
|
||||
val newCropBorders = if (viewer.hasMargins) config.verticalCropBorders else config.webtoonCropBorders
|
||||
|
||||
subsamplingImageView?.apply {
|
||||
if (newCropBorders != cropBorders) {
|
||||
cropBorders = newCropBorders
|
||||
setCropBorders(newCropBorders)
|
||||
}
|
||||
return this
|
||||
}
|
||||
|
||||
cropBorders = newCropBorders
|
||||
|
||||
subsamplingImageView = WebtoonSubsamplingImageView(context).apply {
|
||||
setMaxTileSize(viewer.activity.maxBitmapSize)
|
||||
@ -359,7 +369,7 @@ class WebtoonPageHolder(
|
||||
setMinimumScaleType(SubsamplingScaleImageView.SCALE_TYPE_FIT_WIDTH)
|
||||
setMinimumDpi(90)
|
||||
setMinimumTileDpi(180)
|
||||
setCropBorders(if (viewer.hasMargins) config.verticalCropBorders else config.webtoonCropBorders)
|
||||
setCropBorders(cropBorders)
|
||||
setOnImageEventListener(
|
||||
object : SubsamplingScaleImageView.DefaultOnImageEventListener() {
|
||||
override fun onReady() {
|
||||
|
Loading…
Reference in New Issue
Block a user