fix(POSTV1-editor): 修复多选拖动与底图调整
Dada P0-A isolated Windows CI / validate-and-package (push) Waiting to run

This commit is contained in:
suyx
2026-08-06 10:53:38 +08:00
parent 51d613f459
commit 83fe57f319
8 changed files with 310 additions and 14 deletions
+17
View File
@@ -73,6 +73,10 @@ describe("TDD-WP4-CAN-001 canvas selection and limit", () => {
identity(1).elementId,
identity(2).elementId,
]);
expect(controller.selectAt({ x: 0.2, y: 0.2 }, { append: true, preserveSelection: true })).toEqual([
identity(1).elementId,
identity(2).elementId,
]);
});
});
@@ -97,6 +101,19 @@ describe("TDD-WP4-STK-001 sticker transformations", () => {
});
});
it("uses one bounded delta for distant selected elements", () => {
const controller = new CanvasElementController(state([
sticker(1, { position: { x: 0.1, y: 0.2 } }),
sticker(2, { position: { x: 0.9, y: 0.8 } }),
]));
controller.selectIds([identity(1).elementId, identity(2).elementId]);
controller.moveSelected({ x: 0.2, y: 0.3 }, { snap: false });
expect(controller.value.elements.map(({ position }) => position)).toEqual([
{ x: 0.2, y: 0.4 },
{ x: 1, y: 1 },
]);
});
it("duplicates, reorders and deletes selected stickers while preserving stable resource identity", () => {
const controller = new CanvasElementController(state([sticker(1), sticker(2, { position: { x: 0.7, y: 0.7 } })]));
controller.selectById(identity(1).elementId);