summaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 17:40:38 +0100
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2026-10-27 17:40:55 +0100
commit03732aec10343f16b02df88fc40fb63ed7ae200a (patch)
tree866d8d76eb384e909793b0d966a37bde0f630799 /crates
parent1efd65ef8912b5099b65ecd5029c41481eab6757 (diff)
web: zoom readback + fit tripwire probes (build 27i)
Diffstat (limited to 'crates')
-rw-r--r--crates/wipfel/src/app.rs11
-rw-r--r--crates/wipfel/www/style.css4
2 files changed, 14 insertions, 1 deletions
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::<web_sys::ImageBitmap>);
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::<HtmlCanvasElement>()
@@ -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);