mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	TestEngine: fixed wrong flags passed to ItemInfo queries. Was luckily/misleadingly not causing issues as the test-engine flags we tested were upper bits not colliding with the other type.
Moved those flags higher as well. (unrelated to the fix itself)
This commit is contained in:
		| @@ -1083,7 +1083,7 @@ bool ImGui::Checkbox(const char* label, bool* v) | ||||
|     ItemSize(total_bb, style.FramePadding.y); | ||||
|     if (!ItemAdd(total_bb, id)) | ||||
|     { | ||||
|         IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|         IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
| @@ -1119,7 +1119,7 @@ bool ImGui::Checkbox(const char* label, bool* v) | ||||
|     if (label_size.x > 0.0f) | ||||
|         RenderText(label_pos, label); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|     return pressed; | ||||
| } | ||||
|  | ||||
| @@ -1221,7 +1221,7 @@ bool ImGui::RadioButton(const char* label, bool active) | ||||
|     if (label_size.x > 0.0f) | ||||
|         RenderText(label_pos, label); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); | ||||
|     return pressed; | ||||
| } | ||||
|  | ||||
| @@ -2384,7 +2384,7 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, | ||||
|     if (label_size.x > 0.0f) | ||||
|         RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); | ||||
|     return value_changed; | ||||
| } | ||||
|  | ||||
| @@ -2998,7 +2998,7 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat | ||||
|     if (label_size.x > 0.0f) | ||||
|         RenderText(ImVec2(frame_bb.Max.x + style.ItemInnerSpacing.x, frame_bb.Min.y + style.FramePadding.y), label); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); | ||||
|     return value_changed; | ||||
| } | ||||
|  | ||||
| @@ -4660,7 +4660,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_ | ||||
|     if (value_changed && !(flags & ImGuiInputTextFlags_NoMarkEdited)) | ||||
|         MarkItemEdited(id); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); | ||||
|     if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0) | ||||
|         return enter_pressed; | ||||
|     else | ||||
| @@ -5761,7 +5761,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l | ||||
|     { | ||||
|         if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) | ||||
|             TreePushOverrideID(id); | ||||
|         IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|         IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.LastItemStatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|         return is_open; | ||||
|     } | ||||
|  | ||||
| @@ -5887,7 +5887,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l | ||||
|  | ||||
|     if (is_open && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen)) | ||||
|         TreePushOverrideID(id); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags | (is_leaf ? 0 : ImGuiItemStatusFlags_Openable) | (is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|     return is_open; | ||||
| } | ||||
|  | ||||
| @@ -6154,7 +6154,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl | ||||
|     if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(window->DC.ItemFlags & ImGuiItemFlags_SelectableDontClosePopup)) | ||||
|         CloseCurrentPopup(); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags); | ||||
|     return pressed; | ||||
| } | ||||
|  | ||||
| @@ -6828,7 +6828,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled) | ||||
|     if (want_close && IsPopupOpen(id, ImGuiPopupFlags_None)) | ||||
|         ClosePopupToLevel(g.BeginPopupStack.Size, true); | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(id, label, window->DC.LastItemStatusFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0)); | ||||
|  | ||||
|     if (!menu_is_open && want_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size) | ||||
|     { | ||||
| @@ -6915,7 +6915,7 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, boo | ||||
|             RenderCheckMark(window->DrawList, pos + ImVec2(window->DC.MenuColumns.Pos[2] + extra_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled), g.FontSize  * 0.866f); | ||||
|     } | ||||
|  | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.ItemFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|     IMGUI_TEST_ENGINE_ITEM_INFO(window->DC.LastItemId, label, window->DC.LastItemStatusFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0)); | ||||
|     return pressed; | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user