Add snapping for vector editing

This commit is contained in:
Skyler Lehmkuhl
2026-02-25 03:29:42 -05:00
parent 2b63fdd2c5
commit 4c34c8a17d
8 changed files with 514 additions and 77 deletions
@@ -143,9 +143,14 @@ impl InfopanelPane {
let tool = *shared.selected_tool;
// Only show tool options for tools that have options
let has_options = matches!(
let is_vector_tool = matches!(
tool,
Tool::Draw | Tool::Rectangle | Tool::Ellipse | Tool::PaintBucket | Tool::Polygon | Tool::Line | Tool::RegionSelect
Tool::Select | Tool::BezierEdit | Tool::Draw | Tool::Rectangle
| Tool::Ellipse | Tool::Line | Tool::Polygon
);
let has_options = is_vector_tool || matches!(
tool,
Tool::PaintBucket | Tool::RegionSelect
);
if !has_options {
@@ -159,6 +164,11 @@ impl InfopanelPane {
self.tool_section_open = true;
ui.add_space(4.0);
if is_vector_tool {
ui.checkbox(shared.snap_enabled, "Snap to Geometry");
ui.add_space(2.0);
}
match tool {
Tool::Draw => {
// Stroke width