File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -185,13 +185,16 @@ void GUI::GUILayersList() {
185185 }
186186
187187 if (ImGui::BeginDragDropSource ()) {
188- ImGui::SetDragDropPayload (" APILayer*" , &layer, sizeof (layer));
188+ const size_t index = i;
189+ ImGui::SetDragDropPayload (" APILayerIndex" , &index, sizeof (index));
189190 ImGui::EndDragDropSource ();
190191 }
191192
192193 if (ImGui::BeginDragDropTarget ()) {
193- if (const auto payload = ImGui::AcceptDragDropPayload (" APILayer*" )) {
194- const auto source = *reinterpret_cast <APILayer*>(payload->Data );
194+ if (
195+ const auto payload = ImGui::AcceptDragDropPayload (" APILayerIndex" )) {
196+ auto sourceIndex = *reinterpret_cast <const size_t *>(payload->Data );
197+ const auto & source = mLayers .at (sourceIndex);
195198 DragDropReorder (source, layer);
196199 }
197200 ImGui::EndDragDropTarget ();
You can’t perform that action at this time.
0 commit comments