zijlijn concepten beter geplaatst

This commit is contained in:
2026-09-03 08:50:20 +02:00
parent 2c141b6d3f
commit 1abc84489f
5 changed files with 49 additions and 26 deletions
+31
View File
@@ -218,3 +218,34 @@ test("moving a concept also moves connected concepts that link to another CMap",
linked: [500, 140]
});
});
test("moving a concept schedules one boundary-reference geometry refresh", async () => {
const factory = await loadEditorFactory();
const frames = [];
global.window.requestAnimationFrame = (callback) => frames.push(callback);
const map = {
onSelection() {},
onActivation() {},
node: (attributes) => fakeNode(attributes)
};
const canvas = {
addEventListener() {},
querySelector: () => null,
clientWidth: 1200,
clientHeight: 800,
scrollLeft: 0,
scrollTop: 0,
isConnected: true
};
const editor = factory.createEditor(canvas, { createDiagramEngine: () => map });
const concept = editor.addItem({ id: 1, label: "Inside concept", x: 100, y: 100 });
let refreshCount = 0;
editor.refreshBoundaryReferences = () => { refreshCount += 1; };
editor.handleItemMove(concept, 150, 130);
editor.handleItemMove(concept, 170, 140);
assert.equal(frames.length, 1, "pointer moves in one frame are coalesced");
frames[0]();
assert.equal(refreshCount, 1);
});