Merge pull request #109 from dariomanesku/master

Added other alignment options for imguiImage().
This commit is contained in:
Branimir Karadžić 2014-07-04 21:45:22 -07:00
commit 92000fcb57
2 changed files with 11 additions and 1 deletions

View file

@ -869,6 +869,10 @@ struct Imgui
{
int32_t xx;
if (ImguiImageAlign::Left == _align)
{
xx = m_scrollAreaX + SCROLL_AREA_PADDING;
}
else if (ImguiImageAlign::LeftIndented == _align)
{
xx = m_widgetX;
}
@ -876,10 +880,14 @@ struct Imgui
{
xx = m_scrollAreaX + (m_scrollAreaInnerWidth-_width)/2;
}
else //if (ImguiImageAlign::CenterIndented == _align).
else if (ImguiImageAlign::CenterIndented == _align)
{
xx = (m_widgetX + m_scrollAreaInnerWidth + m_scrollAreaX - _width)/2;
}
else //if (ImguiImageAlign::Right == _align).
{
xx = m_scrollAreaX + m_scrollAreaInnerWidth - _width;
}
const int32_t yy = m_widgetY;
m_widgetY += _height + DEFAULT_SPACING;

View file

@ -46,8 +46,10 @@ struct ImguiImageAlign
enum Enum
{
Left,
LeftIndented,
Center,
CenterIndented,
Right,
};
};