Skip to content

Commit c47fd5f

Browse files
committed
Revert buffering single selection
We solved the "sliver" problem by buffering the selected boundary. Although it "looks nicer" to have the buffer be consistent when toggling between 1 and 2 selected neighbourhoods, buffering affects the aggregated prioritization metrics. But when you have only one neighbourhood selected, the "aggregated" metrics should match that of the one boundary on the map **exactly**. Having the visual buffer jitter a little between 1 and 2 selections is the lesser evil.
1 parent 796c39d commit c47fd5f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

web/src/AutoBoundariesMode.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
if (newBoundaries.size === 0) {
6565
selectedBoundary = null;
6666
selectedBoundaries = newBoundaries;
67+
} else if (newBoundaries.size === 1) {
68+
selectedBoundary = newBoundaries.values().next().value!;
69+
selectedBoundaries = newBoundaries;
6770
} else {
6871
// Aggregate the selected boundaries
69-
// Note: We "aggregate" even when there's only one selected boundary
70-
// because the output is slightly buffered, and we don't want that to jitter
71-
// when toggling between 1 and 2 selected boundaries.
7272
let featureCollection = {
7373
type: "FeatureCollection" as const,
7474
features: Array.from(newBoundaries.values()),

0 commit comments

Comments
 (0)