Step 3 prep: Domain renders at 1.0, add scroll_id to model

This commit is contained in:
wfx 2026-02-04 16:05:58 +01:00
parent 35ff783f25
commit 387afdf4f2
2 changed files with 3 additions and 1 deletions

View file

@ -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(),

View file

@ -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);
}