Skip to content

Commit

Permalink
Bugfix: Adjust the insertion point when moving items.
Browse files Browse the repository at this point in the history
  • Loading branch information
djowel committed Feb 17, 2024
1 parent c675282 commit 04f16b3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/element/drag_and_drop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,14 @@ namespace cycfi { namespace elements
c->move(_insertion_pos, indices);
on_move(_insertion_pos, indices);
if (auto s = find_subject<selection_list_element*>(this))
{
for (int i : indices)
{
if (i <= _insertion_pos)
--_insertion_pos;
}
s->update_selection(_insertion_pos, _insertion_pos+indices.size()-1);
}
}
}

Expand Down

0 comments on commit 04f16b3

Please sign in to comment.