mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	Tweak EndGroup() to facilitate fixing #2550 later (currently should have no side-effect0. Demo: Add extra widget to status query test.
This commit is contained in:
		| @@ -6825,10 +6825,13 @@ void ImGui::EndGroup() | ||||
|  | ||||
|     // If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group. | ||||
|     // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets. | ||||
|     // (and if you grep for LastItemId you'll notice it is only used in that context. | ||||
|     if ((group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId) // && g.ActiveIdWindow->RootWindow == window->RootWindow) | ||||
|     // Also if you grep for LastItemId you'll notice it is only used in that context. | ||||
|     // (The tests not symmetrical because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.) | ||||
|     const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId; | ||||
|     const bool group_contains_prev_active_id = !group_data.BackupActiveIdPreviousFrameIsAlive && g.ActiveIdPreviousFrameIsAlive; | ||||
|     if (group_contains_curr_active_id) | ||||
|         window->DC.LastItemId = g.ActiveId; | ||||
|     else if (!group_data.BackupActiveIdPreviousFrameIsAlive && g.ActiveIdPreviousFrameIsAlive) // && g.ActiveIdPreviousFrameWindow->RootWindow == window->RootWindow) | ||||
|     else if (group_contains_prev_active_id) | ||||
|         window->DC.LastItemId = g.ActiveIdPreviousFrame; | ||||
|     window->DC.LastItemRect = group_bb; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user