mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 05:01:05 +01:00 
			
		
		
		
	Drag and Drop: Added payload->IsPreview() to user can render their custom preview while handling overlapping drop targets. (#143)
This commit is contained in:
		
							
								
								
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -1155,11 +1155,13 @@ struct ImGuiPayload | ||||
|     ImGuiID         SourceParentId;     // Source parent id (if available) | ||||
|     int             DataFrameCount;     // Data timestamp | ||||
|     char            DataType[8 + 1];    // Data type tag (short user-supplied string) | ||||
|     bool            Delivery;           // Set when AcceptDragDropPayload() was called and the mouse button is released over the target item | ||||
|     bool            Preview;            // Set when AcceptDragDropPayload() was called and mouse has been hovering the target item (nb: handle overlapping drag targets) | ||||
|     bool            Delivery;           // Set when AcceptDragDropPayload() was called and mouse button is released over the target item. | ||||
|  | ||||
|     ImGuiPayload()  { Clear(); } | ||||
|     void Clear()    { SourceId = SourceParentId = 0; Data = NULL; DataSize = 0; memset(DataType, 0, sizeof(DataType)); DataFrameCount = -1; Delivery = false; } | ||||
|     void Clear()    { SourceId = SourceParentId = 0; Data = NULL; DataSize = 0; memset(DataType, 0, sizeof(DataType)); DataFrameCount = -1; Preview = Delivery = false; } | ||||
|     bool IsDataType(const char* type) const { return DataFrameCount != -1 && strcmp(type, DataType) == 0; } | ||||
|     bool IsPreview() const                  { return Preview; } | ||||
|     bool IsDelivery() const                 { return Delivery; } | ||||
| }; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user