Design: Text and SVG join Create — they were excluded on a premise that is not true

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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM
This commit is contained in:
Tommaso Bianchi
2026-08-01 17:14:13 +02:00
co-authored by Claude Opus 5
parent d5c5d5675e
commit 447c71a0d2
3 changed files with 51 additions and 4 deletions
+41 -3
View File
@@ -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",
+3 -1
View File
@@ -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
+7
View File
@@ -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.