app crash when resize window
mosayed01 opened this issue · comments
Mohammed Sayed commented
Exception
Cause
using this function throw this exception.
public fun Float.coerceIn(minimumValue: Float, maximumValue: Float): Float {
if (minimumValue > maximumValue) throw IllegalArgumentException("Cannot coerce value to an empty range: maximum $maximumValue is less than minimum $minimumValue.")
if (this < minimumValue) return minimumValue
if (this > maximumValue) return maximumValue
return this
}
Please think in another way to handle it.
I suggest always with canvas use ratio.
AndrewAboAlhana commented
now i tried to use coerceAtMax and AtLeast and it's working well