TheChance101 / AAY-chart

A chart library for Compose Multiplatform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

app crash when resize window

mosayed01 opened this issue · comments

Exception

image

Cause

using this function throw this exception.
image

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.

now i tried to use coerceAtMax and AtLeast and it's working well