Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Loaded cursor thumbnail: its drawing after main's canvas pass, one loaded field per snap context

moppeeerd8b2179b5698
diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs
index ec1f1716b..c993193de 100644
--- a/crates/ui-egui/src/canvas.rs
+++ b/crates/ui-egui/src/canvas.rs
@@ -363,6 +363,11 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) {
draw_loaded_thumbnail(app, &painter, p, &t);
}
}
+ // A second viewport has no panels, dialogs or Quick Apply after its canvas: observe here,
+ // once, as the end of its pass. The root viewport observes at the end of `DesignApp::ui`.
+ if ui.ctx().viewport_id() != egui::ViewportId::ROOT {
+ ime_observe(app, ui.ctx());
+ }
}
/// Longest side of the loaded place cursor's thumbnail, in points.
@@ -414,12 +419,6 @@ fn loaded_thumb_texture(ctx: &egui::Context, doc: &Document, asset: designcraft_
let t = ctx.load_texture("loaded_thumb", crate::widgets::fit_texture(ci, max), egui::TextureOptions::LINEAR);
ctx.data_mut(|d| d.insert_temp(key, t.clone()));
Some(t)
- }
- // A second viewport has no panels, dialogs or Quick Apply after its canvas: observe here,
- // once, as the end of its pass. The root viewport observes at the end of `DesignApp::ui`.
- if ui.ctx().viewport_id() != egui::ViewportId::ROOT {
- ime_observe(app, ui.ctx());
- }
}
/// Presses in a row on the canvas: the last press's count, and where and when it was released
diff --git a/crates/ui-egui/src/canvas/column_guides.rs b/crates/ui-egui/src/canvas/column_guides.rs
index 2cc1d4d0e..c15595442 100644
--- a/crates/ui-egui/src/canvas/column_guides.rs
+++ b/crates/ui-egui/src/canvas/column_guides.rs
@@ -107,7 +107,6 @@ fn snap_gutter(app: &DesignApp, g: &ColumnDrag, want: f64, shift: bool, zoom: f6
unit: app.ui.units,
stroke_in_front: false,
loaded: None,
- loaded: None,
};
let rect = DRect::new(want, m.y0, want + width, m.y1);
let s = designcraft_tools::snap::snap(