Remove offsetY field in GalleryPreview

This commit is contained in:
tarsin committed 2023-05-01 12:00:09 +08:00
1 parent 99ed2b35d3
commit 64e55be02f
3 files changed
+2 -4

No files matched your search

@@ -34,7 +34,6 @@ data class NormalGalleryPreview(
override val imageKey: String,
override val position: Int,
val offsetX: Int,
val offsetY: Int,
val clipWidth: Int,
val clipHeight: Int,
) : GalleryPreview
@@ -495,11 +495,10 @@ object GalleryDetailParser {
val position = it.groupValues[6].toInt() - 1
val imageKey = getPreviewThumbKey(it.groupValues[3].trim())
val xOffset = it.groupValues[4].toIntOrNull() ?: 0
val yOffset = 0
val width = it.groupValues[1].toInt()
val height = it.groupValues[2].toInt()
val pageUrl = it.groupValues[5].trim()
NormalGalleryPreview(imageKey, position, xOffset, yOffset, width, height) to pageUrl
NormalGalleryPreview(imageKey, position, xOffset, width, height) to pageUrl
}.run {
first.toList() to second.toList()
}
@@ -64,7 +64,7 @@ fun EhAsyncPreview(
it.copy(
painter = BitmapPainter(
(it.result.drawable as BitmapDrawable).bitmap.asImageBitmap(),
IntOffset(offsetX, offsetY),
IntOffset(offsetX, 0),
IntSize(clipWidth - 1, clipHeight - 1),
),
)