From fe019c4c5b2d9598c3a95acaf79ffce3bf0587f9 Mon Sep 17 00:00:00 2001 From: Johannes Hofmann Date: Mon, 16 Nov 2026 21:37:16 +0100 Subject: web: repaint canvas when the projection type changes set_projection swaps the projection and the render-body FOV sync rebuilds the peak coordinates, but no CanvasView prop changed, so the canvas kept showing the stale paint - the new positions only appeared when a marker drag happened to trigger a repaint. Bump the redraw tick in the projection dropdown handler. --- crates/gipfel/src/app.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crates') diff --git a/crates/gipfel/src/app.rs b/crates/gipfel/src/app.rs index c3fb430..2728635 100644 --- a/crates/gipfel/src/app.rs +++ b/crates/gipfel/src/app.rs @@ -924,6 +924,7 @@ pub fn app() -> Html { let on_projection = { let pan = pan.clone(); let projection = projection.clone(); + let tick = tick.clone(); Callback::from(move |e: Event| { let sel: web_sys::HtmlSelectElement = e.target_unchecked_into(); let cyl = sel.value() == "1"; @@ -933,6 +934,11 @@ pub fn app() -> Html { } else { ProjectionType::Rectilinear }); + // The peak coordinates change with the projection (the FOV-limit + // sync in the render body rebuilds them), but no CanvasView prop + // changes - bump the redraw tick or the canvas keeps showing the + // stale paint until a marker drag forces a repaint. + tick.set(*tick + 1); }) }; -- cgit v1.2.3