MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / BeginDragDropSourceItem

Function BeginDragDropSourceItem

Source/3rdParty/implot/implot.cpp:4396–4406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4394}
4395
4396bool BeginDragDropSourceItem(const char* label_id, ImGuiDragDropFlags flags) {
4397 SetupLock();
4398 ImPlotContext& gp = *GImPlot;
4399 IM_ASSERT_USER_ERROR(gp.CurrentItems != nullptr, "BeginDragDropSourceItem() needs to be called within an itemized context!");
4400 ImGuiID item_id = ImGui::GetIDWithSeed(label_id, nullptr, gp.CurrentItems->ID);
4401 ImPlotItem* item = gp.CurrentItems->GetItem(item_id);
4402 if (item != nullptr) {
4403 return ImGui::ItemAdd(item->LegendHoverRect, item->ID) && ImGui::BeginDragDropSource(flags);
4404 }
4405 return false;
4406}
4407
4408void EndDragDropSource() {
4409 SetupLock();

Callers 2

Demo_SubplotItemSharingFunction · 0.85
Demo_DragAndDropFunction · 0.85

Calls 2

SetupLockFunction · 0.85
GetItemMethod · 0.80

Tested by

no test coverage detected