From b7fb141d19806c76a89f7d5ee7da43432296d05e Mon Sep 17 00:00:00 2001 From: Lumi Pakkanen Date: Wed, 5 Jun 2024 18:45:00 +0300 Subject: [PATCH] Automatically infer good lattice configuration Inspect scale contents to figure out good initial lattice configuration. ref #680 --- src/components/GridLattice.vue | 2 +- src/stores/grid.ts | 62 +++++++++++++++++- src/stores/state.ts | 2 +- src/views/LatticeView.vue | 114 +++++++++++++++++++++++++++++++-- 4 files changed, 169 insertions(+), 11 deletions(-) diff --git a/src/components/GridLattice.vue b/src/components/GridLattice.vue index 30ec36e9..325fa9aa 100644 --- a/src/components/GridLattice.vue +++ b/src/components/GridLattice.vue @@ -92,7 +92,7 @@ watch(svgElement, (element) => { observer.observe(element) }) -watch(() => store.modulus, computeExtent) +watch(() => [store.viewScale, store.minX, store.maxX, store.minY, store.maxY, store.viewCenterX, store.viewCenterY], computeExtent)