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:
parent
7241342fd8
commit
7905f2c057
@ -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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user