mirror of
https://github.com/fadden/6502bench.git
synced 2024-11-29 10:50:28 +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:
parent
710a8dc679
commit
951c0d7936
@ -147,9 +147,13 @@ namespace CommonWPF {
|
|||||||
// for it, so for now just fudge it.
|
// for it, so for now just fudge it.
|
||||||
const int FUDGE = 4;
|
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);
|
Point p = e.GetPosition(lv);
|
||||||
GridView gv = (GridView)lv.View;
|
GridView gv = (GridView)lv.View;
|
||||||
double startPos = FUDGE;
|
double startPos = FUDGE - scrollPos;
|
||||||
for (int index = 0; index < gv.Columns.Count; index++) {
|
for (int index = 0; index < gv.Columns.Count; index++) {
|
||||||
GridViewColumn col = gv.Columns[index];
|
GridViewColumn col = gv.Columns[index];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user