public static bool DoListReordering <T>(this ImGui gui, Rect moveHandle, Rect contents, T index, out T moveFrom, SchemeColor backgroundColor = SchemeColor.PureBackground, bool updateDraggingObject = true) { var result = false; moveFrom = index; if (!gui.InitiateDrag(moveHandle, contents, index, backgroundColor) && gui.action == ImGuiAction.MouseDrag && gui.ConsumeDrag(contents.Center, index)) { moveFrom = gui.GetDraggingObject <T>(); if (updateDraggingObject) { gui.UpdateDraggingObject(index); } result = true; } return(result); }