From 0b85e7989eacb26d3496cdb98ed3221868a4013f Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 13:41:53 +0100 Subject: web: hidden-peak heuristics in the UI with Show-hidden toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The core already ran both visibility heuristics (height/distance threshold via the Visibility slider, occlusion via mark_hidden with the cone-visibility slope test) — the web UI just ignored FLAG_HIDDEN. - guide dots: hidden peaks are filtered out by default; with the new Display > Show hidden peaks toggle they appear grey instead of green - hover and click hit-testing skip hidden peaks unless the toggle is on - Find Peak picker is unchanged (it lists pan.close, which always includes hidden peaks — same as desktop) --- crates/gipfel-web/src/markers.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'crates/gipfel-web/src/markers.rs') diff --git a/crates/gipfel-web/src/markers.rs b/crates/gipfel-web/src/markers.rs index d1bf8cb..d024f2e 100644 --- a/crates/gipfel-web/src/markers.rs +++ b/crates/gipfel-web/src/markers.rs @@ -34,11 +34,21 @@ pub fn refit(pan: &mut Panorama, markers: &[Marker], fit_distortion: bool) -> Re } /// Nearest visible hill to image position `(x, y)`, within `max_dist` -/// image pixels. Used to resolve marker clicks. -pub fn nearest_hill(pan: &Panorama, x: f64, y: f64, max_dist: f64) -> Option { +/// image pixels. Used to resolve marker clicks. Hills hidden by the +/// occlusion heuristic are skipped unless `show_hidden`. +pub fn nearest_hill( + pan: &Panorama, + x: f64, + y: f64, + max_dist: f64, + show_hidden: bool, +) -> Option { let mut best = None; let mut best_d = max_dist; for &i in &pan.visible { + if !show_hidden && pan.hills[i].flags & gipfel_core::hill::FLAG_HIDDEN != 0 { + continue; + } let h = &pan.hills[i]; let d = (h.x - x).hypot(h.y - y); if d < best_d { -- cgit v1.2.3