Options: snap marker size (#1770)

The object-snap glyphs were fixed at 5 px; a Drafting slider now scales
them from 1 to 20 px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-10-14 12:24:32 +03:00
1 parent d915489a67
commit d5de798f8a
29 files changed
+375 -315

No files matched your search

+3
View File
@@ -369,6 +369,8 @@ pub struct ModelSpaceThemeConfig {
pub grip_hot: u8,
/// GRIPHOVER: hovered/warm grip ACI color (0 = Theme Primary Strong, 1..=255 = ACI).
pub grip_hover: u8,
/// SNAPMARKERSIZE: object-snap marker half-size in pixels (1–20, default 5).
pub snap_marker_size: u8,
}
impl Default for ModelSpaceThemeConfig {
@@ -390,6 +392,7 @@ impl Default for ModelSpaceThemeConfig {
grip_color: 0,
grip_hot: 0,
grip_hover: 0,
snap_marker_size: 5,
}
}
}
+2
View File
@@ -2609,6 +2609,8 @@ pub enum Message {
SelectionHighlightColorChanged(u8),
/// Change Grip size in pixels (1–25, GRIPSIZE).
GripSizeChanged(u8),
/// Change the object-snap marker size in pixels (1–20, SNAPMARKERSIZE).
SnapMarkerSizeChanged(u8),
/// Change Unselected Grip color ACI index (0 = Theme Primary, 1..=255 = ACI, GRIPCOLOR).
GripColorChanged(u8),
/// Change Selected/Hot Grip color ACI index (0 = Theme Danger, 1..=255 = ACI, GRIPHOT).
+6
View File
@@ -9052,6 +9052,12 @@ impl OpenCADStudio {
Task::none()
}
Message::SnapMarkerSizeChanged(size) => {
self.model_space.snap_marker_size = size.clamp(1, 20);
self.persist_settings_if_changed();
Task::none()
}
Message::GripColorChanged(color) => {
self.model_space.grip_color = color;
self.sync_model_space_theme(false);
+1
View File
@@ -958,6 +958,7 @@ bg={bg_ms:.1}ms n={view_count}"
|| c.is_selection_gathering()
}),
snap_color: self.snap_marker_color,
snap_size: self.model_space.snap_marker_size as f32,
},
// MATCHPROP paints properties onto destinations; it gets the
// paintbrush cursor instead of the crosshair.