From ea32f8dc2fc0158c8bb6b1e37cec9cc95088e7df Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Tue, 1 Sep 2026 05:39:28 +0200 Subject: [PATCH] A selected sketch line stops being white, and a refused constraint says why MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two reports, one root: the sketch tab could not show what was selected. The bed grid landed last commit, and selection was painted pure white — a freshly drawn line is auto-selected by the creation tool, so the first thing a new line did was disappear into the grid. Selection now wears design_selection_color(), the same cyan a picked solid already wears. White is kept for the hover handle alone. That invisibility is also why "I apply Parallel and NOTHING HAPPENS": drawing two lines leaves exactly ONE selected (the last), Parallel needs two, so the planner correctly refused — but the status text named only the requirement, never the current pick, which reads as a dead button. It now reports how many are selected and how to pick the second. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_011FbJKJAJxxkhDTs9XdZzKA --- src/slic3r/GUI/CAD/DesignPanel.cpp | 9 ++++++++- src/slic3r/GUI/CAD/DesignSketchTool.cpp | 16 ++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/slic3r/GUI/CAD/DesignPanel.cpp b/src/slic3r/GUI/CAD/DesignPanel.cpp index c80d29ec6f..5266b1f3a9 100644 --- a/src/slic3r/GUI/CAD/DesignPanel.cpp +++ b/src/slic3r/GUI/CAD/DesignPanel.cpp @@ -7848,7 +7848,14 @@ void DesignPanel::apply_live_constraint(SketchConstraintType type) switch (plan.kind) { case ConstraintPlan::Kind::Reject: - fail(constraint_reject_text(plan.reason, type)); + // "I applied Parallel and NOTHING HAPPENS" is this branch. The text named the + // REQUIREMENT ("applies to two lines") but never the CURRENT PICK, and a creation + // tool auto-selects only the entity it just drew — so after drawing two lines exactly + // one is selected and the button correctly refuses. Say how many are picked, or the + // refusal is indistinguishable from a dead button. + fail(wxString::Format(_L("%s — %d selected. Press Esc for the Select tool, click one " + "line, then Shift- or Ctrl-click the other."), + constraint_reject_text(plan.reason, type), int(sel.size()))); return; case ConstraintPlan::Kind::AskValue: m_viewport->open_inline_value(plan.prefill, [this, plan, commit](double v) { diff --git a/src/slic3r/GUI/CAD/DesignSketchTool.cpp b/src/slic3r/GUI/CAD/DesignSketchTool.cpp index 80915760c7..b85b96dda4 100644 --- a/src/slic3r/GUI/CAD/DesignSketchTool.cpp +++ b/src/slic3r/GUI/CAD/DesignSketchTool.cpp @@ -8614,8 +8614,12 @@ void DesignSketchTool::render(GLCanvas3D& canvas) // Committed entities of this session. DoF feedback (P3): a fully-constrained // sketch (dof==0, consistent) paints green; entities touched by a conflicting // constraint paint red; otherwise the under-constrained default (orange / grey - // construction). Selected entities always override to white. - const ColorRGBA white(1.0f, 1.0f, 1.0f, 1.0f); + // construction). Selected entities always override to the shared selection colour. + // NOT white: the Design tab now paints a bed grid, and white-on-grid made a freshly + // drawn (hence auto-selected) line invisible against it. design_selection_color() is + // the same cyan the solid picks already wear, so "selected" reads the same everywhere. + const ColorRGBA white(1.0f, 1.0f, 1.0f, 1.0f); // hover handle only + const ColorRGBA sel_col = design_selection_color(); const ColorRGBA green(0.30f, 0.85f, 0.42f, 1.0f); const ColorRGBA conflict(1.0f, 0.22f, 0.22f, 1.0f); const ColorRGBA opref(0.80f, 0.45f, 1.0f, 1.0f); // violet: the edit-op's reference pick @@ -8645,7 +8649,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) ColorRGBA col; if (editing_this) col = editing; else if (op_ref) col = opref; - else if (selected) col = white; + else if (selected) col = sel_col; else if (bad) col = conflict; else if (e.construction) col = grey; else col = fully ? green : orange; @@ -8666,10 +8670,10 @@ void DesignSketchTool::render(GLCanvas3D& canvas) if (!point_markers.empty()) draw_vertices(m_vertex_model, point_markers, yellow); if (!sel_point_markers.empty()) - draw_vertices(m_highlight_model, sel_point_markers, white); + draw_vertices(m_highlight_model, sel_point_markers, sel_col); // Endpoint / centre handles so individual points are visible and pickable in the - // Select and Dimension tools (a line = a segment + 2 points). Selected ones white. + // Select and Dimension tools (a line = a segment + 2 points). Selected ones cyan. m_show_handles = (m_mode == Mode::Select || m_mode == Mode::Dimension); if (m_show_handles) { std::vector handles, sel_handles; @@ -8704,7 +8708,7 @@ void DesignSketchTool::render(GLCanvas3D& canvas) } } if (!handles.empty()) draw_vertices(m_vertex_model, handles, ColorRGBA(0.65f, 0.65f, 0.30f, 1.0f)); - if (!sel_handles.empty()) draw_vertices(m_highlight_model, sel_handles, white); + if (!sel_handles.empty()) draw_vertices(m_highlight_model, sel_handles, sel_col); // Midpoint of every segment, drawn smaller and cooler than the endpoint handles // (snaporca-te8v). Without it the Midpoint snap is invisible: it exists in the