Added other alignment options for imguiImage().

This commit is contained in:
Dario Manesku 2014-07-05 04:33:00 +01:00
parent bbdd156e3e
commit 4957d23322
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,
};
};