[skip ci]: Remove unnecessary center point calculation code to simplify bitmap transformation logic
This commit is contained in:
@@ -63,10 +63,6 @@ fun Context.applyTransformationToBitmap(bitmap: Bitmap, transformation: Backgrou
|
|||||||
val safeScale = maxOf(0.1f, transformation.scale)
|
val safeScale = maxOf(0.1f, transformation.scale)
|
||||||
matrix.postScale(safeScale, safeScale)
|
matrix.postScale(safeScale, safeScale)
|
||||||
|
|
||||||
// 计算中心点
|
|
||||||
val centerX = targetWidth / 2f
|
|
||||||
val centerY = targetHeight / 2f
|
|
||||||
|
|
||||||
// 计算偏移量,确保不会出现负最大值的问题
|
// 计算偏移量,确保不会出现负最大值的问题
|
||||||
val widthDiff = (bitmap.width * safeScale - targetWidth)
|
val widthDiff = (bitmap.width * safeScale - targetWidth)
|
||||||
val heightDiff = (bitmap.height * safeScale - targetHeight)
|
val heightDiff = (bitmap.height * safeScale - targetHeight)
|
||||||
|
|||||||
Reference in New Issue
Block a user