summaryrefslogtreecommitdiff
path: root/crates/wipfel/src/app.rs
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 17:23:43 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 17:23:43 +0100
commit39297aa49feed815d68b8955769bd3afa3febf10 (patch)
tree55fd27fc38207f6e7057ab9c2ee55682fc88fa25 /crates/wipfel/src/app.rs
parentb502293ac69d0e5f9bb62e2e53a322e4cfc54e62 (diff)
web: probe zoom callback directly (build 27f)
Diffstat (limited to 'crates/wipfel/src/app.rs')
-rw-r--r--crates/wipfel/src/app.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/wipfel/src/app.rs b/crates/wipfel/src/app.rs
index 336e7e6..60a4a15 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::<web_sys::ImageBitmap>);
let view = use_state(ViewState::default);
- let status = use_state(|| "No image loaded · build 27e".to_string());
+ let status = use_state(|| "No image loaded · build 27f".to_string());
let db_status = use_state(|| "Loading hill database…".to_string());
let fit_info = use_state(String::new);
let tick = use_state(|| 0u32);
@@ -670,11 +670,13 @@ 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;
let ns = (v.scale * factor).clamp(0.02, 64.0);
let k = ns / v.scale;
+ status.set(format!("zoom cb f={factor:.3} s {:.4}->{:.4}", v.scale, ns));
view.set(ViewState {
scale: ns,
ox: cx - (cx - v.ox) * k,