committed by
GitHub
parent
3f95c0c746
commit
5508755fde
@@ -123,8 +123,7 @@ class SliderRendererV2(
|
||||
}
|
||||
}
|
||||
|
||||
val sliderPosition = uiTronViewModel.handle.getStateFlow(property.getSliderPositionId(), 0f)
|
||||
.collectAsState()
|
||||
val sliderPosition = remember { mutableStateOf(0f) }
|
||||
|
||||
LaunchedEffect(mvelUuid.value) {
|
||||
val stepMap = mutableMapOf<String, String>()
|
||||
@@ -138,6 +137,7 @@ class SliderRendererV2(
|
||||
)?.toFloat() ?: 0f
|
||||
val totalStep = sliderUiTronData.stepValue?.size.orVal(1) - 1
|
||||
stepToValue.value = stepMap
|
||||
sliderPosition.value = positionIndex
|
||||
steps.value = totalStep
|
||||
thumbX = sliderStart + (positionIndex / totalStep) * (sliderEnd - sliderStart)
|
||||
saveSelectionToHandle(positionIndex.toNearestInt())
|
||||
@@ -176,7 +176,7 @@ class SliderRendererV2(
|
||||
Slider(
|
||||
value = sliderPosition.value,
|
||||
onValueChange = {
|
||||
uiTronViewModel.handle[property.getSliderPositionId()] = it
|
||||
sliderPosition.value = it
|
||||
thumbX = sliderStart + (it / steps.value) * (sliderEnd - sliderStart)
|
||||
updateValuesInMvelActionOnSliderChange(
|
||||
uiTronViewModel,
|
||||
|
||||
Reference in New Issue
Block a user