Skip to content

Commit ff284de

Browse files
committed
Fix FastRedrawApp demo.
1 parent 77c07c0 commit ff284de

File tree

1 file changed

+5
-2
lines changed
  • lets-plot-compose/src/desktopMain/kotlin/org/jetbrains/letsPlot/skia/compose

1 file changed

+5
-2
lines changed

lets-plot-compose/src/desktopMain/kotlin/org/jetbrains/letsPlot/skia/compose/PlotPanelRaw.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ actual fun PlotPanelRaw(
4747
val density = LocalDensity.current.density.toDouble()
4848

4949
// Cache processed plot spec to avoid reprocessing the same raw spec on every recomposition.
50-
val processedPlotSpec by remember(rawSpec) {
51-
mutableStateOf(processRawSpecs(rawSpec, frontendOnly = false))
50+
51+
// Note: Use remember(rawSpec.hashCode()), to bypass the equality check and use the content hash directly.
52+
// The issue was that remember(rawSpec) uses some kind of comparison (equals()?) which somehow not working for `MutableMap`.
53+
val processedPlotSpec = remember(rawSpec.hashCode()) {
54+
processRawSpecs(rawSpec, frontendOnly = false)
5255
}
5356

5457
var panelSize by remember { mutableStateOf(DoubleVector.ZERO) }

0 commit comments

Comments
 (0)