@ -7813,6 +7813,7 @@ ImVec2 ImGui::GetWindowContentRegionMax()
// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
// Lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.)
// Groups are currently a mishmash of functionalities which should perhaps be clarified and separated.
// Groups are currently a mishmash of functionalities which should perhaps be clarified and separated.
// FIXME-OPT: Could we safely early out on ->SkipItems?
void ImGui : : BeginGroup ( )
void ImGui : : BeginGroup ( )
{
{
ImGuiContext & g = * GImGui ;
ImGuiContext & g = * GImGui ;
@ -9978,14 +9979,16 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
return false ;
return false ;
if ( g . ActiveIdMouseButton ! = - 1 )
if ( g . ActiveIdMouseButton ! = - 1 )
mouse_button = g . ActiveIdMouseButton ;
mouse_button = g . ActiveIdMouseButton ;
if ( g . IO . MouseDown [ mouse_button ] = = false )
if ( g . IO . MouseDown [ mouse_button ] = = false | | window - > SkipItems )
return false ;
return false ;
g . ActiveIdAllowOverlap = false ;
g . ActiveIdAllowOverlap = false ;
}
}
else
else
{
{
// Uncommon path: items without ID
// Uncommon path: items without ID
if ( g . IO . MouseDown [ mouse_button ] = = false )
if ( g . IO . MouseDown [ mouse_button ] = = false | | window - > SkipItems )
return false ;
if ( ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) = = 0 & & ( g . ActiveId = = 0 | | g . ActiveIdWindow ! = window ) )
return false ;
return false ;
// If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to:
// If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to:
@ -9996,10 +9999,6 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
return false ;
return false ;
}
}
// Early out
if ( ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) = = 0 & & ( g . ActiveId = = 0 | | g . ActiveIdWindow ! = window ) )
return false ;
// Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image()
// Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image()
// We build a throwaway ID based on current ID stack + relative AABB of items in window.
// We build a throwaway ID based on current ID stack + relative AABB of items in window.
// THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled.
// THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled.
@ -10165,7 +10164,7 @@ bool ImGui::BeginDragDropTarget()
if ( ! ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) )
if ( ! ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HoveredRect ) )
return false ;
return false ;
ImGuiWindow * hovered_window = g . HoveredWindowUnderMovingWindow ;
ImGuiWindow * hovered_window = g . HoveredWindowUnderMovingWindow ;
if ( hovered_window = = NULL | | window - > RootWindow ! = hovered_window - > RootWindow )
if ( hovered_window = = NULL | | window - > RootWindow ! = hovered_window - > RootWindow | | window - > SkipItems )
return false ;
return false ;
const ImRect & display_rect = ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HasDisplayRect ) ? g . LastItemData . DisplayRect : g . LastItemData . Rect ;
const ImRect & display_rect = ( g . LastItemData . StatusFlags & ImGuiItemStatusFlags_HasDisplayRect ) ? g . LastItemData . DisplayRect : g . LastItemData . Rect ;