draw selection rect only if mouse has moved
This commit is contained in:
@@ -260,6 +260,11 @@ private:
|
||||
// paused or slowed, instead of fading on wall-clock time (REQ-SHP-FIRING-BEAM).
|
||||
static constexpr Tick kBeamLifetimeTicks = secondsToTicks(0.3);
|
||||
|
||||
// How far the cursor must travel from the press position, in widget pixels
|
||||
// (Manhattan distance), before a box drag shows its rectangle
|
||||
// (REQ-UI-MULTI-SELECT).
|
||||
static constexpr int kBoxDragThresholdPixels = 2;
|
||||
|
||||
Simulation* m_sim;
|
||||
const GameConfig* m_config;
|
||||
const VisualsConfig* m_visuals;
|
||||
@@ -310,6 +315,15 @@ private:
|
||||
bool m_boxSelecting;
|
||||
QPoint m_boxStartTile;
|
||||
QPoint m_boxCurrentTile;
|
||||
// Where the button went down, in widget pixels; the origin the drag threshold
|
||||
// below measures from. Pixels, not tiles: the threshold separates a click from a
|
||||
// drag, which is a hand-steadiness question and not a tile-sized one.
|
||||
QPoint m_boxStartPos;
|
||||
// Whether the cursor has moved far enough from m_boxStartPos for this to read as
|
||||
// a drag. Until it has, the rectangle is not drawn (REQ-UI-MULTI-SELECT): a plain
|
||||
// click would otherwise flash a one-tile rectangle. Sticky for the rest of the
|
||||
// drag, so coming back to the press position does not hide the rectangle again.
|
||||
bool m_boxDragMoved;
|
||||
|
||||
// Interprets this widget's key events into semantic actions and publishes them
|
||||
// (REQ-UI-HOTKEYS). Owned here for now because this is the widget that holds
|
||||
|
||||
Reference in New Issue
Block a user