diff options
| author | Pietro Gagliardi <[email protected]> | 2014-12-16 18:40:58 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-12-16 18:40:58 -0500 |
| commit | b9c46d4cdfea9dab2df0731f92875ca86f46dfb3 (patch) | |
| tree | d7f7539be3a99246c88ae607424e899bb019ffe6 | |
| parent | 54a359d260fe12b3e0dad71640a47a8235fc4b52 (diff) | |
Don't try to scroll if we're deselecting. First part of mouse deselect fix.
| -rw-r--r-- | wintable/new/select.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/wintable/new/select.h b/wintable/new/select.h index 9be5c89..fec8ba8 100644 --- a/wintable/new/select.h +++ b/wintable/new/select.h @@ -36,6 +36,10 @@ static void doselect(struct table *t, intptr_t row, intptr_t column) if (t->selectedColumn >= t->nColumns) panic("sanity check failure: new Table selection invalid (column out of range)"); + // only scroll if we selected something + if (t->selectedRow == -1 || t->selectedColumn == -1) + goto noScroll; + if (GetClientRect(t->hwnd, &client) == 0) panic("error getting Table client rect in doselect()"); client.top += t->headerHeight; @@ -76,6 +80,7 @@ static void doselect(struct table *t, intptr_t row, intptr_t column) hscrollto(t, (xpos + width) - t->hpagesize); } +noScroll: // now redraw the old and new /rows/ // we do this after scrolling so the rectangles to be invalidated make sense r.left = client.left; |
