aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
authorRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 08:26:35 +0100
committerRubén Beltrán del Río <jj@r.bdr.sh>2026-01-16 11:57:13 +0100
commit81cd06b3334f2f91f6a1ab62a28e11c7d0c677eb (patch)
treef0b0cf37b406eda2dec8db4382aeb5f606cd1f0d /src/handlers
parent4211b2ae06777d5bbe8261a1ab5c0dd057829a35 (diff)
Add preferences
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/export.rs4
-rw-r--r--src/handlers/view.rs2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/handlers/export.rs b/src/handlers/export.rs
index 7438ef9..45e980e 100644
--- a/src/handlers/export.rs
+++ b/src/handlers/export.rs
@@ -9,12 +9,12 @@ use wmap_renderer::{render_to_png, render_to_svg};
pub fn export_to_file(model: &AppModel, path: PathBuf, format: ImageFormat) {
let result: Result<(), String> = match format {
ImageFormat::Png => {
- render_to_png(&model.map, model.stage_type, &model.render_configuration)
+ render_to_png(&model.map, &model.stage_type, &model.render_configuration)
.map_err(|e| e.to_string())
.and_then(|data| std::fs::write(&path, data).map_err(|e| e.to_string()))
}
ImageFormat::Svg => {
- render_to_svg(&model.map, model.stage_type, &model.render_configuration)
+ render_to_svg(&model.map, &model.stage_type, &model.render_configuration)
.map_err(|e| e.to_string())
.and_then(|data| std::fs::write(&path, data).map_err(|e| e.to_string()))
}
diff --git a/src/handlers/view.rs b/src/handlers/view.rs
index 64aeb98..57f526a 100644
--- a/src/handlers/view.rs
+++ b/src/handlers/view.rs
@@ -14,7 +14,7 @@ pub fn change_orientation(model: &mut AppModel) {
/// Updates the selected stage type from dropdown selection.
pub fn stage_type_selected(model: &mut AppModel, index: usize) {
if index < ALL_STAGE_TYPES.len() {
- model.stage_type = ALL_STAGE_TYPES[index];
+ model.stage_type = ALL_STAGE_TYPES[index].clone();
model.update_image();
}
}