Skip to content

Commit 3497c0b

Browse files
authored
Issue #398: touching the continuity composer doesn't work when it's really long and you scroll (#401)
1 parent 95d15f6 commit 3497c0b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

LATEST_RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Bugs addressed in this release:
44

55
* [#399](../../issues/399) Wrong reference number used in animations
6+
* [#398](../../issues/398) touching the continuity composer doesn't work when it's really long and you scroll
67

78
Other changes:
89

src/CustomListViewPanel.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,15 @@ int CustomListViewPanel::HeightToCell(int which) const
151151

152152
void CustomListViewPanel::OnLeftDownMouseEvent(wxMouseEvent& event)
153153
{
154-
m_firstPress = m_lastLocation = event.GetPosition();
155-
// printf("Mouse down @(%d, %d)\n", event.GetPosition().x, event.GetPosition().y);
154+
m_firstPress = m_lastLocation = CalcUnscrolledPosition(event.GetPosition());
155+
wxClientDC dc{ this };
156+
156157
// which cell would this be?
157-
auto which_cell = WhichCell(event.GetPosition());
158+
auto which_cell = WhichCell(m_firstPress);
158159
m_selected = which_cell;
159160
m_dragging = true;
160161
if (which_cell < mCells.size()) {
161-
auto mouse_click = event.GetPosition();
162+
auto mouse_click = m_firstPress;
162163
mouse_click.y -= HeightToCell(which_cell);
163164
mCells.at(which_cell)->OnClick(mouse_click);
164165
}
@@ -167,9 +168,8 @@ void CustomListViewPanel::OnLeftDownMouseEvent(wxMouseEvent& event)
167168

168169
void CustomListViewPanel::OnLeftDoubleClick(wxMouseEvent& event)
169170
{
170-
// printf("Mouse down @(%d, %d)\n", event.GetPosition().x, event.GetPosition().y);
171171
// which cell would this be?
172-
auto which_cell = WhichCell(event.GetPosition());
172+
auto which_cell = WhichCell(CalcUnscrolledPosition(event.GetPosition()));
173173
if (which_cell < mCells.size()) {
174174
OnEditEntry(which_cell);
175175
}
@@ -180,9 +180,8 @@ void CustomListViewPanel::OnLeftUpMouseEvent(wxMouseEvent& event)
180180
{
181181
auto starting_cell = WhichCell(m_firstPress);
182182
m_lastLocation = m_firstPress;
183-
// printf("Mouse up @(%d, %d)\n", event.GetPosition().x, event.GetPosition().y);
184183
// which cell would this be?
185-
auto which_cell = WhichCell(event.GetPosition());
184+
auto which_cell = WhichCell(CalcUnscrolledPosition(event.GetPosition()));
186185
if (starting_cell != which_cell) {
187186
// reorder.
188187
OnMoveEntry(starting_cell, which_cell);
@@ -196,7 +195,7 @@ void CustomListViewPanel::OnLeftUpMouseEvent(wxMouseEvent& event)
196195
void CustomListViewPanel::OnMouseMove(wxMouseEvent& event)
197196
{
198197
if (event.LeftIsDown() && event.GetPosition().y >= 0) {
199-
m_lastLocation = event.GetPosition();
198+
m_lastLocation = CalcUnscrolledPosition(event.GetPosition());
200199
}
201200
Refresh();
202201
}

0 commit comments

Comments
 (0)