fix Ctrl+click no longer deselecting
Regression from the SelectionController extraction. The original started a box drag only in the empty-space branch, after the building, actor and debris hits had each returned. Pulling the hit resolution out into selectAtPoint left the box drag behind as unconditional, so every click started one. That made a click on an object resolve twice: once on press, and again on release as a 1x1 box over the same tile. For a plain click both resolutions are Replace with the same object, so nothing looked wrong. For Ctrl+click the second resolution toggled the object straight back on, so it never deselected - and the selection rectangle drawn during the drag is the box that should not have been started. selectAtPoint now reports whether it hit anything, and only a click that hit nothing starts a box drag. The SelectionController itself was correct, and its tests still pass: the bug was entirely in the widget wiring, which nothing on this branch can test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JcReq7hVk4KUPhTDKWAG7K
This commit is contained in:
@@ -193,8 +193,9 @@ private:
|
||||
void pruneDespawnedActors();
|
||||
// Resolves a click into the selection it should produce, applying the category
|
||||
// precedence of REQ-UI-SELECTION-CATEGORIES; the controller owns what that then
|
||||
// does to the existing selection.
|
||||
void selectAtPoint(QPoint tile, QVector2D worldPos, bool additive);
|
||||
// does to the existing selection. Returns false when the click hit nothing,
|
||||
// which is the only case that goes on to start a box drag.
|
||||
bool selectAtPoint(QPoint tile, QVector2D worldPos, bool additive);
|
||||
void selectInBox(bool additive);
|
||||
void stepSpeed(int delta);
|
||||
void placeAtTile(QPoint tile);
|
||||
|
||||
Reference in New Issue
Block a user