Drag and Drop: moved "drag souce doesn't report as hovered" from ButtonBehavior() to ItemHoverable().

Ensure DragXXX, SliderXXXX, InputText, PlotXXX follow same logic. Amend 251f178a6, a33f0d1f7
This commit is contained in:
ocornut
2023-06-27 14:41:51 +02:00
parent a2f6581171
commit d5d4d709c7
3 changed files with 7 additions and 4 deletions

View File

@ -4050,6 +4050,10 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
return false;
}
// Drag source doesn't report as hovered
if (g.DragDropActive && g.DragDropPayload.SourceId == id && !(g.DragDropSourceFlags & ImGuiDragDropFlags_SourceNoDisableHover))
return false;
// We exceptionally allow this function to be called with id==0 to allow using it for easy high-level
// hover test in widgets code. We could also decide to split this function is two.
if (id != 0)