From 56826fb4771488ce5759828137355432b24455cc Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Sat, 10 Sep 2022 19:34:27 +0600 Subject: [PATCH] Cleanup logic of `onStripSplit` in WebtoonPageHolder 2 (#7976) --- .../ui/reader/viewer/webtoon/WebtoonPageHolder.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 3556b5d27..6221c65b3 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 @@ -300,11 +300,12 @@ class WebtoonPageHolder( // If we have reached this point [page] and its stream shouldn't be null val page = page!! val stream = page.stream!! - val splitData = ImageUtil.getSplitDataForStream(imageStream) + val splitData = ImageUtil.getSplitDataForStream(imageStream).toMutableList() + val currentSplitData = splitData.removeFirst() val newPages = splitData.map { StencilPage(page) { ImageUtil.splitStrip(it, stream) } - }.toMutableList() - return newPages.removeFirst().stream!!() + } + return ImageUtil.splitStrip(currentSplitData) { imageStream } .also { // Running [onLongStripSplit] first results in issues with splitting viewer.onLongStripSplit(page, newPages)