mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-30 20:51:06 +01:00 
			
		
		
		
	Drag and Drop: Elapse payload as soon as delivery is made. (#153)
This commit is contained in:
		
							
								
								
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -4442,10 +4442,14 @@ void ImGui::EndFrame() | |||||||
|     if (g.NavWindowingTarget) |     if (g.NavWindowingTarget) | ||||||
|         NavUpdateWindowingList(); |         NavUpdateWindowingList(); | ||||||
|  |  | ||||||
|     // Drag and Drop: Elapse payload (if source stops being submitted) |     // Drag and Drop: Elapse payload (if delivered, or if source stops being submitted) | ||||||
|     if (g.DragDropActive && g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) |     if (g.DragDropActive) | ||||||
|         if ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)) |     { | ||||||
|  |         bool is_delivered = g.DragDropPayload.Delivery; | ||||||
|  |         bool is_elapsed = (g.DragDropPayload.DataFrameCount + 1 < g.FrameCount) && ((g.DragDropSourceFlags & ImGuiDragDropFlags_SourceAutoExpirePayload) || !IsMouseDown(g.DragDropMouseButton)); | ||||||
|  |         if (is_delivered || is_elapsed) | ||||||
|             ClearDragDrop(); |             ClearDragDrop(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|     // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing. |     // Drag and Drop: Fallback for source tooltip. This is not ideal but better than nothing. | ||||||
|     if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount) |     if (g.DragDropActive && g.DragDropSourceFrameCount < g.FrameCount) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user