Remove useless derivedStateOf
This commit is contained in:
parent
9d4e9fe2d2
commit
dca7bf0a77
1 changed files with 8 additions and 13 deletions
|
|
@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.derivedStateOf
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
|
|
@ -51,14 +50,10 @@ fun LiveWaveformView(
|
|||
linePadding: Dp = 2.dp,
|
||||
) {
|
||||
var canvasSize by remember { mutableStateOf(DpSize(0.dp, 0.dp)) }
|
||||
|
||||
var parentWidth by remember { mutableIntStateOf(0) }
|
||||
|
||||
val waveformWidth by remember(levels.size, lineWidth, linePadding) {
|
||||
derivedStateOf {
|
||||
val waveformWidth = remember(levels.size, lineWidth, linePadding) {
|
||||
levels.size * (lineWidth.value + linePadding.value)
|
||||
}
|
||||
}
|
||||
|
||||
Box(
|
||||
contentAlignment = Alignment.CenterEnd,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue