Indent(), Unindent(): Allow passing negative values.

This commit is contained in:
omar
2017-12-07 18:51:48 +01:00
parent 7f2b9ea4c0
commit 97edd42fc0
2 changed files with 4 additions and 4 deletions

View File

@ -10892,7 +10892,7 @@ void ImGui::Indent(float indent_w)
{
ImGuiContext& g = *GImGui;
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;
}
@ -10900,7 +10900,7 @@ void ImGui::Unindent(float indent_w)
{
ImGuiContext& g = *GImGui;
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;
}