mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-10-26 12:27:30 +00:00 
			
		
		
		
	Merge branch 'master' into docking
# Conflicts: # examples/imgui_impl_dx12.cpp # imgui.cpp # imgui.h # imgui_widgets.cpp
This commit is contained in:
		
							
								
								
									
										37
									
								
								imgui.cpp
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								imgui.cpp
									
									
									
									
									
								
							| @@ -362,13 +362,14 @@ CODE | ||||
|  - 2019/XX/XX (1.XX) - Moved IME support functions from io.ImeSetInputScreenPosFn, io.ImeWindowHandle to the PlatformIO api. | ||||
|  | ||||
|  | ||||
|  - 2019/10/22 (1.74) - removed redirecting functions/enums that were marked obsolete in 1.52 (October 2017): Begin() (5 arguments signature), IsRootWindowOrAnyChildHovered(), AlignFirstTextHeightToWidgets(), SetNextWindowPosCenter(), ImFont::Glyph. Grep this log for details and new names, or see how they were implemented until 1.73. | ||||
|  - 2019/10/14 (1.74) - inputs: Fixed a miscalculation in the keyboard/mouse "typematic" repeat delay/rate calculation, used by keys and e.g. repeating mouse buttons as well as the GetKeyPressedAmount() function. | ||||
|                        if you were using a non-default value for io.KeyRepeatRate (previous default was 0.250), you can add +io.KeyRepeatDelay to it to compensate for the fix. | ||||
|                        The function was triggering on: 0.0 and (delay+rate*N) where (N>=1). Fixed formula responds to (N>=0). Effectively it made io.KeyRepeatRate behave like it was set to (io.KeyRepeatRate + io.KeyRepeatDelay). | ||||
|                        If you never altered io.KeyRepeatRate nor used GetKeyPressedAmount() this won't affect you. | ||||
|  - 2019/07/15 (1.72) - removed TreeAdvanceToLabelPos() which is rarely used and only does SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()). Kept redirection function (will obsolete). | ||||
|  - 2019/07/12 (1.72) - renamed ImFontAtlas::CustomRect to ImFontAtlasCustomRect. Kept redirection typedef (will obsolete). | ||||
|  - 2019/06/14 (1.72) - removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017): ImGuiCol_Column*, ImGuiSetCond_*, IsItemHoveredRect(), IsPosHoveringAnyWindow(), IsMouseHoveringAnyWindow(), IsMouseHoveringWindow(), IMGUI_ONCE_UPON_A_FRAME. Grep this log for details and new names. | ||||
|  - 2019/06/14 (1.72) - removed redirecting functions/enums names that were marked obsolete in 1.51 (June 2017): ImGuiCol_Column*, ImGuiSetCond_*, IsItemHoveredRect(), IsPosHoveringAnyWindow(), IsMouseHoveringAnyWindow(), IsMouseHoveringWindow(), IMGUI_ONCE_UPON_A_FRAME. Grep this log for details and new names, or see how they were implemented until 1.71. | ||||
|  - 2019/06/07 (1.71) - rendering of child window outer decorations (bg color, border, scrollbars) is now performed as part of the parent window. If you have | ||||
|                        overlapping child windows in a same parent, and relied on their relative z-order to be mapped to their submission order, this will affect your rendering. | ||||
|                        This optimization is disabled if the parent window has no visual output, because it appears to be the most common situation leading to the creation of overlapping child windows. | ||||
| @@ -2839,8 +2840,13 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y) | ||||
|     if (window->SkipItems) | ||||
|         return; | ||||
|  | ||||
|     // We increase the height in this function to accommodate for baseline offset. | ||||
|     // In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor, | ||||
|     // but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect. | ||||
|     const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f; | ||||
|     const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y); | ||||
|  | ||||
|     // Always align ourselves on pixel boundaries | ||||
|     const float line_height = ImMax(window->DC.CurrLineSize.y, size.y); | ||||
|     //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG] | ||||
|     window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x; | ||||
|     window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y; | ||||
| @@ -6468,22 +6474,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) | ||||
|     return !skip_items; | ||||
| } | ||||
|  | ||||
| // Old Begin() API with 5 parameters, avoid calling this version directly! Use SetNextWindowSize()/SetNextWindowBgAlpha() + Begin() instead. | ||||
| #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS | ||||
| bool ImGui::Begin(const char* name, bool* p_open, const ImVec2& size_first_use, float bg_alpha_override, ImGuiWindowFlags flags) | ||||
| { | ||||
|     // Old API feature: we could pass the initial window size as a parameter. This was misleading because it only had an effect if the window didn't have data in the .ini file. | ||||
|     if (size_first_use.x != 0.0f || size_first_use.y != 0.0f) | ||||
|         SetNextWindowSize(size_first_use, ImGuiCond_FirstUseEver); | ||||
|  | ||||
|     // Old API feature: override the window background alpha with a parameter. | ||||
|     if (bg_alpha_override >= 0.0f) | ||||
|         SetNextWindowBgAlpha(bg_alpha_override); | ||||
|  | ||||
|     return Begin(name, p_open, flags); | ||||
| } | ||||
| #endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS | ||||
|  | ||||
| void ImGui::End() | ||||
| { | ||||
|     ImGuiContext& g = *GImGui; | ||||
| @@ -7248,15 +7238,6 @@ void ImGui::SetNextWindowPos(const ImVec2& pos, ImGuiCond cond, const ImVec2& pi | ||||
|     g.NextWindowData.PosUndock = true; | ||||
| } | ||||
|  | ||||
| #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS | ||||
| void ImGui::SetNextWindowPosCenter(ImGuiCond cond) | ||||
| { | ||||
|     ImGuiViewport* viewport = ImGui::GetMainViewport(); | ||||
|     SetNextWindowPos(viewport->Pos + viewport->Size * 0.5f, cond, ImVec2(0.5f, 0.5f)); | ||||
|     SetNextWindowViewport(viewport->ID); | ||||
| } | ||||
| #endif | ||||
|  | ||||
| void ImGui::SetNextWindowSize(const ImVec2& size, ImGuiCond cond) | ||||
| { | ||||
|     ImGuiContext& g = *GImGui; | ||||
| @@ -7667,7 +7648,7 @@ void ImGui::EndGroup() | ||||
|     } | ||||
|  | ||||
|     window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset);      // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now. | ||||
|     ItemSize(group_bb.GetSize(), 0.0f); | ||||
|     ItemSize(group_bb.GetSize()); | ||||
|     ItemAdd(group_bb, 0); | ||||
|  | ||||
|     // 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. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 omar
					omar