Werkzeuge: Bogen-Werkzeug (arcCommand, 3-Klick CCW) + Toolbar/Icon/i18n verdrahtet

This commit is contained in:
2026-07-05 15:44:05 +02:00
parent 5130a050ff
commit bd2b12bfb7
8 changed files with 207 additions and 1 deletions
+15
View File
@@ -541,6 +541,19 @@ const circleTool: Tool = {
onCancel: (s) => [s, { draft: null, done: true }],
};
// Bogen: Platzhalter-Werkzeug, gekoppelt an den `arc`-Befehl (3 Klicks:
// Mitte → Start/Radius → Ende). Wie Kreis nicht floorOnly.
const arcTool: Tool = {
id: "arc",
labelKey: "tool.arc",
hintKey: () => "tool.arc.hint",
init: () => ({ phase: "idle" }),
onClick: (s) => [s, { draft: null }],
onMove: (s) => [s, { draft: null }],
onCommitGesture: (s) => [s, { draft: null, done: true }],
onCancel: (s) => [s, { draft: null, done: true }],
};
// ── Registry ─────────────────────────────────────────────────────────────────
const TOOLS: Record<ToolId, Tool> = {
@@ -555,6 +568,7 @@ const TOOLS: Record<ToolId, Tool> = {
polyline: polylineTool,
rect: rectTool,
circle: circleTool,
arc: arcTool,
};
/** Liefert das Werkzeug zur ID. */
@@ -575,4 +589,5 @@ export const TOOL_ORDER: ToolId[] = [
"polyline",
"rect",
"circle",
"arc",
];
+2 -1
View File
@@ -19,7 +19,8 @@ export type ToolId =
| "line"
| "polyline"
| "rect"
| "circle";
| "circle"
| "arc";
// ── Snapping ───────────────────────────────────────────────────────────────