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();
|
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(() => {
|
$effect(() => {
|
||||||
// recomputed when the selection or the files change
|
reducedLayer.update($statistics, distances, $tolerance);
|
||||||
const stats = $statistics;
|
|
||||||
const distances = engine.reductionDistances();
|
|
||||||
reducedLayer.update(stats, distances, $tolerance);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
|
|||||||
Reference in new issue
Block a user