task(CAD-14): phase 1 - tool exclusivity, V2 dispatcher exclusive for V2 tools (was: both engines had same tool = multi elements per click), selection handles now render in pixi mode via overlay pass, E2E proof test added
This commit is contained in:
@@ -304,6 +304,7 @@ const CanvasArea: React.FC<CanvasAreaProps> = ({
|
||||
interaction.setElements(elements);
|
||||
spatialIndex.clear();
|
||||
spatialIndex.bulkInsert(elements);
|
||||
renderEngine.setOverlayElements(elements);
|
||||
renderEngine.render();
|
||||
|
||||
// CAD-13-fix: Bestands-Elemente (aus DB geladen) müssen in Pixi gespiegelt
|
||||
@@ -447,12 +448,13 @@ const CanvasArea: React.FC<CanvasAreaProps> = ({
|
||||
useEffect(() => {
|
||||
const interaction = interactionRef.current;
|
||||
if (!interaction) return;
|
||||
interaction.setTool(activeTool as ToolType);
|
||||
// Task A4.1: V2-Werkzeuge zusätzlich an den Dispatcher routen (Flag aktiv).
|
||||
// Legacy bleibt parallel aktiv für noch nicht migrierte Tools.
|
||||
dispatcherRef.current?.setActive(
|
||||
pluginRegistry.getToolV2(activeTool) ? activeTool : null,
|
||||
);
|
||||
// CAD-14: EXKLUSIVITAET — V2-Werkzeuge laufen AUSSCHLIESSLICH ueber den
|
||||
// InteractionDispatcher. Die Legacy-Engine bekommt sie nicht mehr
|
||||
// (vorher hatten BEIDE dasselbe Tool aktiv => jeder Klick erzeugte
|
||||
// mehrfach Elemente). Nur Tools ohne V2-Entsprechung laufen legacy.
|
||||
const isV2 = !!pluginRegistry.getToolV2(activeTool);
|
||||
interaction.setTool(isV2 ? null : (activeTool as ToolType));
|
||||
dispatcherRef.current?.setActive(isV2 ? activeTool : null);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [activeTool]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user