| 4394 | } |
| 4395 | |
| 4396 | bool 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 | |
| 4408 | void EndDragDropSource() { |
| 4409 | SetupLock(); |
no test coverage detected