Skip to content

Commit

Permalink
#6107: Allow dragging a layer out of the hierarchy, making it top-lev…
Browse files Browse the repository at this point in the history
…el again
  • Loading branch information
codereader committed Oct 2, 2022
1 parent 6554149 commit 5a04e90
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions radiant/ui/layers/LayerControlDialog.cpp
Expand Up @@ -731,10 +731,11 @@ void LayerControlDialog::onDrop(wxDataViewEvent& ev)
return;
}

wxDataViewItem item(ev.GetItem());
auto item = ev.GetItem();
wxutil::TreeModel::Row row(item, *_layerStore);

auto targetLayerId = row[_columns.id].getInteger();
// If an empty item is passed we're supposed to make it top-level again
auto targetLayerId = item.IsOk() ? row[_columns.id].getInteger() : -1;

// Read the source layer ID and veto the event if it's the same as the source ID
if (auto obj = dynamic_cast<wxTextDataObject*>(ev.GetDataObject()); obj)
Expand Down

0 comments on commit 5a04e90

Please sign in to comment.