mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-10-31 13:11:05 +01:00 
			
		
		
		
	Indent(), Unindent(): Allow passing negative values.
This commit is contained in:
		| @@ -10892,7 +10892,7 @@ void ImGui::Indent(float indent_w) | |||||||
| { | { | ||||||
|     ImGuiContext& g = *GImGui; |     ImGuiContext& g = *GImGui; | ||||||
|     ImGuiWindow* window = GetCurrentWindow(); |     ImGuiWindow* window = GetCurrentWindow(); | ||||||
|     window->DC.IndentX += (indent_w > 0.0f) ? indent_w : g.Style.IndentSpacing; |     window->DC.IndentX += (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; | ||||||
|     window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; |     window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; | ||||||
| } | } | ||||||
|  |  | ||||||
| @@ -10900,7 +10900,7 @@ void ImGui::Unindent(float indent_w) | |||||||
| { | { | ||||||
|     ImGuiContext& g = *GImGui; |     ImGuiContext& g = *GImGui; | ||||||
|     ImGuiWindow* window = GetCurrentWindow(); |     ImGuiWindow* window = GetCurrentWindow(); | ||||||
|     window->DC.IndentX -= (indent_w > 0.0f) ? indent_w : g.Style.IndentSpacing; |     window->DC.IndentX -= (indent_w != 0.0f) ? indent_w : g.Style.IndentSpacing; | ||||||
|     window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; |     window->DC.CursorPos.x = window->Pos.x + window->DC.IndentX + window->DC.ColumnsOffsetX; | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										4
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								imgui.h
									
									
									
									
									
								
							| @@ -218,8 +218,8 @@ namespace ImGui | |||||||
|     IMGUI_API void          NewLine();                                                          // undo a SameLine() |     IMGUI_API void          NewLine();                                                          // undo a SameLine() | ||||||
|     IMGUI_API void          Spacing();                                                          // add vertical spacing |     IMGUI_API void          Spacing();                                                          // add vertical spacing | ||||||
|     IMGUI_API void          Dummy(const ImVec2& size);                                          // add a dummy item of given size |     IMGUI_API void          Dummy(const ImVec2& size);                                          // add a dummy item of given size | ||||||
|     IMGUI_API void          Indent(float indent_w = 0.0f);                                      // move content position toward the right, by style.IndentSpacing or indent_w if >0 |     IMGUI_API void          Indent(float indent_w = 0.0f);                                      // move content position toward the right, by style.IndentSpacing or indent_w if != 0 | ||||||
|     IMGUI_API void          Unindent(float indent_w = 0.0f);                                    // move content position back to the left, by style.IndentSpacing or indent_w if >0 |     IMGUI_API void          Unindent(float indent_w = 0.0f);                                    // move content position back to the left, by style.IndentSpacing or indent_w if != 0 | ||||||
|     IMGUI_API void          BeginGroup();                                                       // lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) |     IMGUI_API void          BeginGroup();                                                       // lock horizontal starting position + capture group bounding box into one "item" (so you can use IsItemHovered() or layout primitives such as SameLine() on whole group, etc.) | ||||||
|     IMGUI_API void          EndGroup(); |     IMGUI_API void          EndGroup(); | ||||||
|     IMGUI_API ImVec2        GetCursorPos();                                                     // cursor position is relative to window position |     IMGUI_API ImVec2        GetCursorPos();                                                     // cursor position is relative to window position | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user