mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-17 20:31:57 -05:00
Added other alignment options for imguiImage().
This commit is contained in:
parent
bbdd156e3e
commit
4957d23322
2 changed files with 11 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -46,8 +46,10 @@ struct ImguiImageAlign
|
|||
enum Enum
|
||||
{
|
||||
Left,
|
||||
LeftIndented,
|
||||
Center,
|
||||
CenterIndented,
|
||||
Right,
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue