mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-09 23:26:31 +00:00
fix reactivity
This commit is contained in:
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(() => {
|
||||
|
||||
Reference in new issue
Block a user