mirror of
https://git.mihon.tech/mihonapp/mihon
synced 2024-11-22 13:15:47 +03:00
Cleanup logic of onStripSplit
in WebtoonPageHolder 2 (#7976)
This commit is contained in:
parent
171d7f2b8c
commit
56826fb477
1 changed files with 4 additions and 3 deletions
|
@ -300,11 +300,12 @@ class WebtoonPageHolder(
|
||||||
// If we have reached this point [page] and its stream shouldn't be null
|
// If we have reached this point [page] and its stream shouldn't be null
|
||||||
val page = page!!
|
val page = page!!
|
||||||
val stream = page.stream!!
|
val stream = page.stream!!
|
||||||
val splitData = ImageUtil.getSplitDataForStream(imageStream)
|
val splitData = ImageUtil.getSplitDataForStream(imageStream).toMutableList()
|
||||||
|
val currentSplitData = splitData.removeFirst()
|
||||||
val newPages = splitData.map {
|
val newPages = splitData.map {
|
||||||
StencilPage(page) { ImageUtil.splitStrip(it, stream) }
|
StencilPage(page) { ImageUtil.splitStrip(it, stream) }
|
||||||
}.toMutableList()
|
}
|
||||||
return newPages.removeFirst().stream!!()
|
return ImageUtil.splitStrip(currentSplitData) { imageStream }
|
||||||
.also {
|
.also {
|
||||||
// Running [onLongStripSplit] first results in issues with splitting
|
// Running [onLongStripSplit] first results in issues with splitting
|
||||||
viewer.onLongStripSplit(page, newPages)
|
viewer.onLongStripSplit(page, newPages)
|
||||||
|
|
Loading…
Reference in a new issue