fix: 去除拼图maxCellDimension=800上限,直接使用原图尺寸×缩放因子
This commit is contained in:
Binary file not shown.
@@ -232,7 +232,6 @@ object ImageProcessor {
|
||||
val rows = layoutType.rows
|
||||
|
||||
val cellSpacing = 16
|
||||
val maxCellDimension = 800
|
||||
|
||||
// 根据第一张图片的原始尺寸确定单元格宽高比
|
||||
val firstBitmap = images.firstOrNull()?.let { tryLoadBitmap(context, it) }
|
||||
@@ -242,17 +241,11 @@ object ImageProcessor {
|
||||
Pair(1, 1)
|
||||
}
|
||||
|
||||
// 基准单元格大小(限制不超过maxCellDimension)
|
||||
val longer = maxOf(srcW, srcH)
|
||||
val baseScale = if (longer > maxCellDimension) maxCellDimension.toFloat() / longer else 1.0f
|
||||
val baseCellWidth = (srcW * baseScale).toInt()
|
||||
val baseCellHeight = (srcH * baseScale).toInt()
|
||||
// 原图尺寸 × 质量缩放因子
|
||||
val cellWidth = (srcW * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||
val cellHeight = (srcH * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||
|
||||
// 根据质量等级缩放
|
||||
val cellWidth = (baseCellWidth * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||
val cellHeight = (baseCellHeight * quality.scaleFactor).toInt().coerceAtLeast(1)
|
||||
|
||||
val outputWidth = (cellWidth * cols + cellSpacing * (cols + 1)).coerceAtLeast(480)
|
||||
val outputWidth = cellWidth * cols + cellSpacing * (cols + 1)
|
||||
|
||||
// 底部文字区域高度 - 动态计算
|
||||
val textAreaHeight = if (bottomTitle.isNotBlank() || bottomContent.isNotBlank()) {
|
||||
|
||||
Reference in New Issue
Block a user