fix reactivity

This commit is contained in:
vcoppe committed 2026-10-08 08:47:14 +02:00
1 parent bec1ce4c9b
commit f0851086c0
1 file changed
+7 -4
@@ -29,11 +29,14 @@
let reducedLayer = new ReducedLayer();
// read again only when the selection or the files change, not with the tolerance
let distances = $derived.by(() => {
void $statistics;
return engine.reductionDistances();
});
$effect(() => {
// recomputed when the selection or the files change
const stats = $statistics;
const distances = engine.reductionDistances();
reducedLayer.update(stats, distances, $tolerance);
reducedLayer.update($statistics, distances, $tolerance);
});
$effect(() => {