Add key to SchemeView
This commit is contained in:
parent
9c5c4b5747
commit
b68fa02fa4
@ -1,7 +1,7 @@
|
|||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
kotlin.version=1.6.10
|
kotlin.version=1.6.10
|
||||||
|
|
||||||
compose.version=1.2.0-alpha01-dev774
|
compose.version=1.2.0-beta01
|
||||||
|
|
||||||
agp.version=4.2.2
|
agp.version=4.2.2
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
@ -45,7 +45,8 @@ public fun SchemeView(
|
|||||||
featuresState: SchemeFeaturesState,
|
featuresState: SchemeFeaturesState,
|
||||||
config: SchemeViewConfig = SchemeViewConfig(),
|
config: SchemeViewConfig = SchemeViewConfig(),
|
||||||
modifier: Modifier = Modifier.fillMaxSize(),
|
modifier: Modifier = Modifier.fillMaxSize(),
|
||||||
) {
|
) = key(initialViewPoint) {
|
||||||
|
|
||||||
var canvasSize by remember { mutableStateOf(defaultCanvasSize) }
|
var canvasSize by remember { mutableStateOf(defaultCanvasSize) }
|
||||||
|
|
||||||
var viewPoint by remember { mutableStateOf(initialViewPoint) }
|
var viewPoint by remember { mutableStateOf(initialViewPoint) }
|
||||||
@ -133,7 +134,7 @@ public fun SchemeView(
|
|||||||
setViewPoint(newViewPoint)
|
setViewPoint(newViewPoint)
|
||||||
}.fillMaxSize()
|
}.fillMaxSize()
|
||||||
|
|
||||||
val painterCache = key(featuresState){
|
val painterCache = key(featuresState) {
|
||||||
featuresState.features().values.filterIsInstance<PainterFeature>().associateWith { it.painter() }
|
featuresState.features().values.filterIsInstance<PainterFeature>().associateWith { it.painter() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user