diff --git a/lib/widgets/editor/tree_widgets/commands/command_group_widget.dart b/lib/widgets/editor/tree_widgets/commands/command_group_widget.dart index fc879db1..937bb149 100644 --- a/lib/widgets/editor/tree_widgets/commands/command_group_widget.dart +++ b/lib/widgets/editor/tree_widgets/commands/command_group_widget.dart @@ -197,9 +197,8 @@ class CommandGroupWidget extends StatelessWidget { }, itemCount: command.commands.length, onReorder: (oldIndex, newIndex) { - // The fact that this needs to be here is so dumb - if (newIndex >= command.commands.length) { - newIndex = command.commands.length - 1; + if (oldIndex < newIndex) { + newIndex -= 1; } undoStack.add(Change(