Fix index bug when moving note downwards

To reproduce: Move a note to a later position in the same parent. The
note does not appear where it should. This can even panic when trying to
move a note after the last child.
This commit is contained in:
Joscha 2025-02-17 01:34:44 +01:00
parent b76ed55a39
commit f465f50614

View file

@ -212,7 +212,7 @@ impl Store {
let mut to_idx = Self::resolve_child_position(&to.children, to_position);
if from_id == to_id && from_idx < to_idx {
to_idx += 1;
to_idx -= 1;
}
let removed_id = self