forked from 1b-agent/opencadstudio-upstream
fix(dimension): complete ordinate workflow
This commit is contained in:
1 parent
97ec3ed67e
commit
e34b67c709
9 files changed
+442
-78
No files matched your search
@@ -1246,6 +1246,12 @@ impl OpenCADStudio {
|
||||
.document
|
||||
.header
|
||||
.dimension_associativity;
|
||||
let single_source_dimension = matches!(
|
||||
&entity,
|
||||
acadrust::EntityType::Dimension(
|
||||
acadrust::entities::Dimension::Ordinate(_)
|
||||
)
|
||||
);
|
||||
let pending = if association_mode == 0 {
|
||||
let layer = self.tabs[i].active_layer.clone();
|
||||
if layer != "0" || entity.as_entity().layer().is_empty() {
|
||||
@@ -1295,7 +1301,13 @@ impl OpenCADStudio {
|
||||
if association_mode == 2 {
|
||||
let sources = source.map_or_else(
|
||||
|| self.tabs[i].scene.infer_dimension_sources(handle),
|
||||
|source| [Some(source), Some(source)],
|
||||
|source| {
|
||||
if single_source_dimension {
|
||||
[Some(source), None]
|
||||
} else {
|
||||
[Some(source), Some(source)]
|
||||
}
|
||||
},
|
||||
);
|
||||
self.tabs[i]
|
||||
.scene
|
||||
@@ -3066,7 +3078,6 @@ impl OpenCADStudio {
|
||||
stretched |= mv(&mut d.definition_point);
|
||||
}
|
||||
Dimension::Ordinate(d) => {
|
||||
stretched |= mv(&mut d.definition_point);
|
||||
stretched |= mv(&mut d.feature_location);
|
||||
stretched |= mv(&mut d.leader_endpoint);
|
||||
}
|
||||
|
||||
@@ -1154,10 +1154,17 @@ pub(super) fn on_tab_close(&mut self, idx: usize) -> Task<Message> {
|
||||
.zip(self.tabs[i].selected_grips.iter())
|
||||
.find(|(owner, g)| **owner == popup.handle && g.id == popup.grip_id)
|
||||
{
|
||||
// "Move with Leader" drags the whole multileader; the
|
||||
// others move just the picked grip.
|
||||
// The synthetic whole-object grip is specific to a
|
||||
// multileader. Dimension text grips implement their
|
||||
// own leader relationship and must keep their real ID.
|
||||
let is_multileader = matches!(
|
||||
self.tabs[i].scene.document.get_entity(popup.handle),
|
||||
Some(acadrust::EntityType::MultiLeader(_))
|
||||
);
|
||||
let (grip_id, is_translate) =
|
||||
if matches!(item.action, GripMenuAction::MoveWithLeader) {
|
||||
if matches!(item.action, GripMenuAction::MoveWithLeader)
|
||||
&& is_multileader
|
||||
{
|
||||
(crate::entities::multileader::MOVE_ALL_GRIP, true)
|
||||
} else {
|
||||
(popup.grip_id, g.is_midpoint)
|
||||
|
||||
Reference in new issue
Block a user