From 03732aec10343f16b02df88fc40fb63ed7ae200a Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Tue, 27 Oct 2026 17:40:38 +0100 Subject: web: zoom readback + fit tripwire probes (build 27i) --- crates/wipfel/src/app.rs | 11 ++++++++++- crates/wipfel/www/style.css | 4 ++++ 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/wipfel/src/app.rs b/crates/wipfel/src/app.rs index 843aaa0..de64e06 100644 --- a/crates/wipfel/src/app.rs +++ b/crates/wipfel/src/app.rs @@ -149,7 +149,7 @@ fn find_peak_panel(p: &FpProps) -> Html { pub fn app() -> Html { let bitmap = use_state(|| None::); let view = use_state(ViewState::default); - let status = use_state(|| "No image loaded · build 27g".to_string()); + let status = use_state(|| "No image loaded · build 27i".to_string()); let db_status = use_state(|| "Loading hill database…".to_string()); let fit_info = use_state(String::new); let tick = use_state(|| 0u32); @@ -225,7 +225,9 @@ pub fn app() -> Html { let bitmap = bitmap.clone(); let view = view.clone(); let canvas_ref = canvas_ref.clone(); + let status = status.clone(); Callback::from(move |_: MouseEvent| { + status.set("FIT ran".to_string()); let Some(bmp) = bitmap.as_ref() else { return }; let (cw, ch) = canvas_ref .cast::() @@ -670,6 +672,7 @@ pub fn app() -> Html { zoom: { let view = view.clone(); let user_moved = user_moved.clone(); + let status = status.clone(); Callback::from(move |(cx, cy, factor): (f64, f64, f64)| { *user_moved.borrow_mut() = true; let v = &*view; @@ -680,6 +683,12 @@ pub fn app() -> Html { ox: cx - (cx - v.ox) * k, oy: cy - (cy - v.oy) * k, }); + status.set(format!( + "zoom {:.4}->{:.4} readback {:.4}", + v.scale, + ns, + view.scale + )); }) }, click: { diff --git a/crates/wipfel/www/style.css b/crates/wipfel/www/style.css index baceb49..646444d 100644 --- a/crates/wipfel/www/style.css +++ b/crates/wipfel/www/style.css @@ -68,6 +68,10 @@ body { bottom: 6px; left: 8px; right: 8px; + /* do NOT let long status text widen the flex container (that + stretched the canvas and re-anchored the fit on every update) */ + width: min-content; + max-width: calc(100% - 16px); font-size: 11px; color: #e8e8ea; background: rgba(16, 16, 20, 0.7); -- cgit v1.2.3