From 44b84ab80061de0691e3bba5a65c093312528212 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sat, 5 Jul 2014 01:50:11 +0100 Subject: [PATCH] Added ImguiImageAlign::CenterIndented. --- examples/common/imgui/imgui.cpp | 8 ++++++-- examples/common/imgui/imgui.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index 06e9cfd3..48f584ea 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -872,9 +872,13 @@ struct Imgui { xx = m_widgetX; } - else //if (ImguiImageAlign::Center == _align). + else if (ImguiImageAlign::Center == _align) { - xx = m_widgetX + (m_scrollAreaInnerWidth-_width)/2; + xx = m_scrollAreaX + (m_scrollAreaInnerWidth-_width)/2; + } + else //if (ImguiImageAlign::CenterIndented == _align). + { + xx = (m_widgetX + m_scrollAreaInnerWidth + m_scrollAreaX - _width)/2; } const int32_t yy = m_widgetY; diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index 3eae7cb3..aa91dc22 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -49,6 +49,7 @@ struct ImguiImageAlign { Left, Center, + CenterIndented, }; };