From d837109076fbd25e096b250973bfb429b15d617d Mon Sep 17 00:00:00 2001 From: ramox81 <184937705+ramox81@users.noreply.github.com> Date: Fri, 18 Sep 2026 18:49:48 +0300 Subject: [PATCH] Let other constraints reconcile a partly fixed entity's free points 8) A moved entity that a Fixed holds only in part no longer pins its free points as hard anchors: they stay where the edit put them unless another constraint on the entity (e.g. Vertical) moves them, so the fixed point holds and the solve no longer fails when the two disagree. Co-Authored-By: Claude Fable 5.1 --- src/scene/parametric_solve.rs | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/src/scene/parametric_solve.rs b/src/scene/parametric_solve.rs index 688c18592..fe9a0afd2 100644 --- a/src/scene/parametric_solve.rs +++ b/src/scene/parametric_solve.rs @@ -2224,30 +2224,13 @@ fn solve_scope( })) }) }; - let mut driven_refs: Vec = + // A moved entity a Fixed holds only in part gets no temporary pin and + // (below) no size retention, so its free points simply stay where the + // edit put them while the fixed ones pull their own coordinates back — + // a MOVE on a line with one fixed end stretches the line instead of + // sliding it — and any other constraint on it reconciles the rest. + let driven_refs: Vec = driven_refs.iter().copied().filter(|r| !held_by_fixed(r)).collect(); - // A moved entity a Fixed holds only in part keeps its other primary - // points where the edit put them (driven), so the fixed ones pull just - // their own coordinates back — a MOVE on a line with one fixed end - // stretches the line instead of sliding it. - for reference in initial_fixed_refs { - if reference.marker.is_some() || !fixed_refs.iter().any(|f| f.entity == reference.entity) - { - continue; - } - let Some(entity) = document.get_entity(reference.entity) else { - continue; - }; - for (marker, _) in super::parametric_constraints::parametric_point_candidates(entity) { - let point = ParametricRef::point(reference.entity, marker); - if (marker >= 0 || marker == -3) - && !held_by_fixed(&point) - && !driven_refs.contains(&point) - { - driven_refs.push(point); - } - } - } let driven_refs = driven_refs.as_slice(); let fixed_touches = |handle: Handle| fixed_refs.iter().any(|f| f.entity == handle); let line_axes = if retain_lengths { HashMap::new() } else { constrained_line_axes(&constraints) };