fix: selection bugs — arrow tool click select, box-select on empty drag, preserve selection on tool switch

This commit is contained in:
A0 Orchestrator
2026-07-01 23:46:57 +02:00
parent 7b19a99b24
commit 2eead4c1aa
3 changed files with 51 additions and 5 deletions
+15
View File
@@ -272,6 +272,21 @@ describe('SelectionEngine', () => {
s.selectionEngine.cancelBoxSelect();
expect(s.selectionEngine.isBoxSelecting()).toBe(false);
});
it('hasBoxMoved should return false when box not started', () => {
expect(s.selectionEngine.hasBoxMoved()).toBe(false);
});
it('hasBoxMoved should return false when start equals end (no drag)', () => {
s.selectionEngine.startBoxSelect(50, 50);
expect(s.selectionEngine.hasBoxMoved()).toBe(false);
});
it('hasBoxMoved should return true when box end differs from start', () => {
s.selectionEngine.startBoxSelect(50, 50);
s.selectionEngine.updateBoxSelect(100, 100, []);
expect(s.selectionEngine.hasBoxMoved()).toBe(true);
});
});
describe('clearSelection', () => {