From 2b152ce2127f6c1a479af6b4d23a1ed60831b041 Mon Sep 17 00:00:00 2001 From: Tushar <144731286+tushar11kh@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:10:24 +0530 Subject: [PATCH] corrected index for reordering layer --- lib/pro_image_editor/features/reorder_layer_example.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pro_image_editor/features/reorder_layer_example.dart b/lib/pro_image_editor/features/reorder_layer_example.dart index a8bb1235..7b53d72b 100644 --- a/lib/pro_image_editor/features/reorder_layer_example.dart +++ b/lib/pro_image_editor/features/reorder_layer_example.dart @@ -145,6 +145,10 @@ class _ReorderLayerSheetState extends State { if (oldIndex == 0 || newIndex == 0) { return; } + + if (oldIndex < newIndex) { + newIndex -= 1; + } widget.onReorder(oldIndex, newIndex); }, );