From bcd044923824d0661853653cc185447a4f5ac591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Wed, 2 Aug 2023 09:11:34 +0200 Subject: [PATCH] Because we're checking for strict inequality of the distance to the best facet, it could happen that we displayed 2 tips if the pointer was exactly at the same distance from two target points in different facets. This fixes this corner case. --- src/interactions/pointer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interactions/pointer.js b/src/interactions/pointer.js index 70555efd3d..e5b54de304 100644 --- a/src/interactions/pointer.js +++ b/src/interactions/pointer.js @@ -84,8 +84,8 @@ function pointerK(kx, ky, {x, y, px, py, maxRadius = 40, channels, render, ...op facetState.set(index.fi, ri); f = requestAnimationFrame(() => { f = null; - for (const r of facetState.values()) { - if (r < ri) { + for (const [fi, r] of facetState) { + if (r < ri || (r === ri && fi < index.fi)) { ii = null; break; }