1
0
mirror of https://github.com/fadden/6502bench.git synced 2024-06-12 08:29:29 +00:00

Fix ListView click locator

The code that figures out which row and column you clicked in wasn't
taking horizontal scrolling into account.  Issue #49.
This commit is contained in:
Andy McFadden 2019-10-06 10:46:55 -07:00
parent 1908dab360
commit 847dd47f01

View File

@ -147,9 +147,13 @@ namespace CommonWPF {
// for it, so for now just fudge it.
const int FUDGE = 4;
// Need to take horizontal scrolling into account.
ScrollViewer sv = lv.GetVisualChild<ScrollViewer>();
double scrollPos = sv.HorizontalOffset;
Point p = e.GetPosition(lv);
GridView gv = (GridView)lv.View;
double startPos = FUDGE;
double startPos = FUDGE - scrollPos;
for (int index = 0; index < gv.Columns.Count; index++) {
GridViewColumn col = gv.Columns[index];