From 447c71a0d25ddb2a3fcd1960d15fce1e089781d7 Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sat, 1 Aug 2026 17:14:13 +0200 Subject: [PATCH] =?UTF-8?q?Design:=20Text=20and=20SVG=20join=20Create=20?= =?UTF-8?q?=E2=80=94=20they=20were=20excluded=20on=20a=20premise=20that=20?= =?UTF-8?q?is=20not=20true?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirror of snaporca 6724ea27c5 (DesignPanel.cpp applied as a patch; parity 30, shared files byte-identical). chrome_only's rule is "acts on the DOCUMENT, not on a selection". Text and SVG both call add_imported_sketch(), which drops the art on a picked solid face via SketchPlane::from_face() — a selection-consuming profile creator, like Sketch. Now sk_text / sk_svg in the sketch half's Create row, where their toolbar buttons already sit. Verified on the rig: Create ends Point, Text, SVG. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM --- docs/ux/tool_atlas.json | 44 +++++++++++++++++++++++++++++++--- src/slic3r/GUI/DesignOffer.hpp | 4 +++- src/slic3r/GUI/DesignPanel.cpp | 7 ++++++ 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/docs/ux/tool_atlas.json b/docs/ux/tool_atlas.json index c9b390af6a..36ecd479ad 100644 --- a/docs/ux/tool_atlas.json +++ b/docs/ux/tool_atlas.json @@ -1537,6 +1537,46 @@ "gui": true, "action": "key:P" }, + { + "id": "sk_text", + "name": "Text", + "slot": "create", + "key": null, + "feature": "Sketch", + "mcp": null, + "accepts": [ + "sk_none", + "sk_point", + "sk_line", + "sk_arc", + "sk_2ent" + ], + "needs": {}, + "refusal": null, + "gui": true, + "action": "btn:text", + "mode": "sketch" + }, + { + "id": "sk_svg", + "name": "SVG", + "slot": "create", + "key": null, + "feature": "Sketch", + "mcp": null, + "accepts": [ + "sk_none", + "sk_point", + "sk_line", + "sk_arc", + "sk_2ent" + ], + "needs": {}, + "refusal": null, + "gui": true, + "action": "btn:svg", + "mode": "sketch" + }, { "id": "sk_offset", "name": "Offset", @@ -1820,12 +1860,10 @@ } ], "chrome_only": { - "_why": "document-level actions act on the DOCUMENT, not on a selection, so they stay in chrome and never enter the offer (see 4.1)", + "_why": "document-level actions act on the DOCUMENT, not on a selection, so they stay in chrome and never enter the offer (see 4.1) Text and SVG were removed from this list 2026-08-01: they create a Sketch feature on the picked face, so they consume a selection like any other Create verb.", "items": [ "Import STEP", "Import mesh", - "Text", - "SVG", "Export STEP", "Commit to Plate", "Undo", diff --git a/src/slic3r/GUI/DesignOffer.hpp b/src/slic3r/GUI/DesignOffer.hpp index 5d4bf16a48..875b87c9c7 100644 --- a/src/slic3r/GUI/DesignOffer.hpp +++ b/src/slic3r/GUI/DesignOffer.hpp @@ -148,6 +148,8 @@ static const OfferVerb kOfferVerbs[] = { {"sk_poly_inscribed", "Inscribed", 0, nullptr, "btn:polyfit#0", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon"}, {"sk_poly_circumscribed", "Circumscribed", 0, nullptr, "btn:polyfit#1", nullptr, 0x000f8000u, 0, 0, false, true, "Polygon"}, {"sk_point_t", "Point", 0, "P", "key:P", nullptr, 0x000f8000u, 0, 0, false, true, nullptr}, + {"sk_text", "Text", 0, nullptr, "btn:text", nullptr, 0x000f8000u, 0, 0, false, true, nullptr}, + {"sk_svg", "SVG", 0, nullptr, "btn:svg", nullptr, 0x000f8000u, 0, 0, false, true, nullptr}, {"sk_offset", "Offset", 1, "O", "key:O", nullptr, 0x000b0000u, 0, 0, false, true, nullptr}, {"sk_trim", "Trim", 2, "T", "key:T", nullptr, 0x000b0000u, 0, 0, false, true, nullptr}, {"sk_fillet", "Fillet", 3, "F", "key:F", nullptr, 0x00090000u, 0, 0, false, true, nullptr}, @@ -164,7 +166,7 @@ static const OfferVerb kOfferVerbs[] = { {"sk_extend", "Extend", 7, "X", "key:X", nullptr, 0x000b0000u, 0, 0, false, true, nullptr}, {"sk_delete", "Delete", 7, "Del", "btn:delete", nullptr, 0x000f0000u, 0, 0, false, true, nullptr}, }; -static const int kOfferVerbCount = 84; +static const int kOfferVerbCount = 86; }} // namespace Slic3r::GUI diff --git a/src/slic3r/GUI/DesignPanel.cpp b/src/slic3r/GUI/DesignPanel.cpp index 4946e51b50..f62b299da3 100644 --- a/src/slic3r/GUI/DesignPanel.cpp +++ b/src/slic3r/GUI/DesignPanel.cpp @@ -1176,6 +1176,13 @@ DesignPanel::DesignPanel(wxWindow* parent) auto* b_svg = icon_btn("design_svg", _L("SVG — import an outline as a profile")); b_svg->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { on_import_svg(); }); sadd(b_svg); + // …and reachable from the offer's Create row. These were on the atlas's chrome_only + // list under "document-level actions act on the DOCUMENT, not on a selection" — which + // is not what they do: both call add_imported_sketch(), which drops the art ON a + // picked solid face (SketchPlane::from_face, centred on it) exactly as Sketch does. + // Selection-consuming profile creators, so they belong with the other Create verbs. + m_verb_actions["btn:text"] = [this] { on_add_text(); }; + m_verb_actions["btn:svg"] = [this] { on_import_svg(); }; } add_sep(m_tb_sketch); // In-canvas edit-op tools (drag gizmo / click label), grouped by family.