diff options
| author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-16 21:37:16 +0100 |
|---|---|---|
| committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2026-11-16 21:37:16 +0100 |
| commit | fe019c4c5b2d9598c3a95acaf79ffce3bf0587f9 (patch) | |
| tree | 65373f7dd03a13fd31ae161920086614f597f97e | |
| parent | e55c99df67bc1e569d8754401923f220505a43da (diff) | |
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.
| -rw-r--r-- | crates/gipfel/src/app.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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); }) }; |
