From 387afdf4f2f318f3e59eed0bba0cafd1d9407081 Mon Sep 17 00:00:00 2001 From: wfx Date: Wed, 4 Feb 2026 16:05:58 +0100 Subject: [PATCH] Step 3 prep: Domain renders at 1.0, add scroll_id to model --- src/ui/model.rs | 2 ++ src/ui/sync.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ui/model.rs b/src/ui/model.rs index e2789fa..0071aa5 100644 --- a/src/ui/model.rs +++ b/src/ui/model.rs @@ -112,6 +112,7 @@ pub struct AppModel { pub scale: f32, pub canvas_size: Size, pub image_size: Size, + pub scroll_id: cosmic::widget::Id, // Tool state pub tool_mode: ToolMode, @@ -150,6 +151,7 @@ impl AppModel { scale: 1.0, canvas_size: Size::ZERO, image_size: Size::ZERO, + scroll_id: cosmic::widget::Id::new("canvas-scroll"), // Tool state tool_mode: ToolMode::None, crop_selection: CropSelection::default(), diff --git a/src/ui/sync.rs b/src/ui/sync.rs index 70672e1..81790a3 100644 --- a/src/ui/sync.rs +++ b/src/ui/sync.rs @@ -52,7 +52,7 @@ pub fn sync_model_from_manager(model: &mut AppModel, manager: &mut DocumentManag pub fn sync_render_data(model: &mut AppModel, manager: &mut DocumentManager) { if let Some(doc) = manager.current_document_mut() { // Re-render at current scale to get updated image handle - if let Ok(render_output) = doc.render(model.scale as f64) { + if let Ok(render_output) = doc.render(1.0) { model.current_image_handle = Some(render_output.handle); }