Merge pull request #1320 from ghost/styled-dimension-preview

This commit is contained in:
Hakan Seven committed 2026-09-17 07:11:10 +03:00
commit 79bc800728
23 files changed
+724 -138

No files matched your search

+24
View File
@@ -1345,6 +1345,23 @@ pub enum DimensionBreakOperation {
Remove,
}
/// A transient dimension built for the placement preview.
pub struct DimensionPreview {
pub entity: EntityType,
/// Keep the base dimension's style instead of the current one
/// (`DIMCONTINUE` / `DIMBASELINE` with `DIMCONTINUEMODE=1`).
pub preserve_base_style: bool,
}
impl DimensionPreview {
pub fn current_style(entity: EntityType) -> Self {
Self {
entity,
preserve_base_style: false,
}
}
}
/// Returned by every `CadCommand` method to tell main.rs what to do.
#[allow(dead_code)]
pub enum CmdResult {
@@ -2279,6 +2296,13 @@ pub trait CadCommand: Send {
false
}
/// Dimensions the command would commit if the cursor were clicked now.
/// `None` means this stage has no committable dimension; an empty list
/// means the geometry is degenerate and nothing styled should be shown.
fn dimension_preview(&self, _cursor: DVec3) -> Option<Vec<DimensionPreview>> {
None
}
/// Needs entity hit-testing instead of point input.
fn needs_entity_pick(&self) -> bool {
false