fix: Fix for inset of SENSOR_INFO_ACTIVE_ARRAY_SIZE for Android < 11 (#2306)

fix for inset of SENSOR_INFO_ACTIVE_ARRAY_SIZE

Co-authored-by: David Gruseck <david.gruseck@actinate.com>
This commit is contained in:
David Gruseck 2023-12-22 10:59:23 +01:00 committed by GitHub
parent 7241342fd8
commit 7905f2c057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,9 @@ import android.graphics.Rect
fun Rect.zoomed(zoomFactor: Float): Rect { fun Rect.zoomed(zoomFactor: Float): Rect {
val dx = (width() / zoomFactor / 2).toInt() val dx = (width() / zoomFactor / 2).toInt()
val dy = (height() / zoomFactor / 2).toInt() val dy = (height() / zoomFactor / 2).toInt()
val left = centerX() - dx val left = centerX() - this.left - dx
val top = centerY() - dy val top = centerY() - this.top - dy
val right = centerX() + dx val right = centerX() - this.left + dx
val bottom = centerY() + dy val bottom = centerY() - this.top + dy
return Rect(left, top, right, bottom) return Rect(left, top, right, bottom)
} }