mirror of
https://github.com/mihonapp/mihon.git
synced 2026-10-16 13:48:09 -07:00
Bump webgpuviewer (#4051)
This commit is contained in:
@@ -1156,6 +1156,7 @@ open class WebGpuViewer(
|
|||||||
page.page.downloadStream?.let { startStreamDecode(page, it) }
|
page.page.downloadStream?.let { startStreamDecode(page, it) }
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
is Page.State.Error -> {
|
is Page.State.Error -> {
|
||||||
logcat(LogPriority.ERROR) { "Page load error: ${state.error}" }
|
logcat(LogPriority.ERROR) { "Page load error: ${state.error}" }
|
||||||
false
|
false
|
||||||
@@ -1626,8 +1627,12 @@ open class WebGpuViewer(
|
|||||||
// not wide enough
|
// not wide enough
|
||||||
if (aspectRatio < 1.1) return false
|
if (aspectRatio < 1.1) return false
|
||||||
|
|
||||||
// Wide page: half the image width is wider than the screen aspect ratio
|
// Wide page: half of it is wider than the screen aspect ratio or matches a decoded neighbour's shape
|
||||||
if (aspectRatio <= 2f * screenW.toFloat() / screenH) return false
|
val isWide = listOf(viewerPageFor(page)?.prev, viewerPageFor(page)?.next)
|
||||||
|
.mapNotNull { (it as? ViewerReaderPage)?.aspectRatio }
|
||||||
|
.any { abs(aspectRatio / 2f - it) <= pairAspectTolerance } ||
|
||||||
|
(aspectRatio > 2f * screenW.toFloat() / screenH)
|
||||||
|
if (!isWide) return false
|
||||||
|
|
||||||
page.parent = pager.state
|
page.parent = pager.state
|
||||||
|
|
||||||
@@ -1743,6 +1748,7 @@ open class WebGpuViewer(
|
|||||||
if (cachedPage.page.status == Page.State.Queue) requestDownload(cachedPage)
|
if (cachedPage.page.status == Page.State.Queue) requestDownload(cachedPage)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
PageState.DECODING -> return
|
PageState.DECODING -> return
|
||||||
// Ready requeues it, once downloaded.
|
// Ready requeues it, once downloaded.
|
||||||
PageState.QUEUED -> decodeQueue.remove(cachedPage)
|
PageState.QUEUED -> decodeQueue.remove(cachedPage)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ tapmoc = "0.4.2"
|
|||||||
unifile = "08f224c8f9"
|
unifile = "08f224c8f9"
|
||||||
valkyrie = "0.5.2"
|
valkyrie = "0.5.2"
|
||||||
voyager = "2.2.21-1.10.3"
|
voyager = "2.2.21-1.10.3"
|
||||||
webgpuviewer = "51"
|
webgpuviewer = "52"
|
||||||
xmlutil = "1.0.2"
|
xmlutil = "1.0.2"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|||||||
Reference in New Issue
Block a user