Magic wand selection

This commit is contained in:
Skyler Lehmkuhl
2026-03-07 03:39:09 -05:00
parent 1e80b1bc77
commit 1900792fa9
6 changed files with 345 additions and 87 deletions
@@ -184,7 +184,7 @@ impl InfopanelPane {
let has_options = is_vector_tool || is_raster_paint_tool || is_raster_transform || matches!(
tool,
Tool::PaintBucket | Tool::RegionSelect
Tool::PaintBucket | Tool::RegionSelect | Tool::MagicWand
);
if !has_options {
@@ -326,6 +326,34 @@ impl InfopanelPane {
}
}
Tool::MagicWand => {
use crate::tools::FillThresholdMode;
ui.horizontal(|ui| {
ui.label("Threshold:");
ui.add(
egui::Slider::new(
&mut shared.raster_settings.wand_threshold,
0.0_f32..=255.0,
)
.step_by(1.0),
);
});
ui.horizontal(|ui| {
ui.label("Mode:");
ui.selectable_value(
&mut shared.raster_settings.wand_mode,
FillThresholdMode::Absolute,
"Absolute",
);
ui.selectable_value(
&mut shared.raster_settings.wand_mode,
FillThresholdMode::Relative,
"Relative",
);
});
ui.checkbox(&mut shared.raster_settings.wand_contiguous, "Contiguous");
}
Tool::Polygon => {
// Number of sides
ui.horizontal(|ui| {