Added optional _height param for imguiSeparator() and imguiSeparatorLine().

This commit is contained in:
Dario Manesku 2014-08-10 15:22:24 +01:00
parent b9af3544ad
commit 9f31587b09
2 changed files with 11 additions and 11 deletions

View File

@ -1529,18 +1529,18 @@ struct Imgui
m_widgetW += INDENT_SIZE; m_widgetW += INDENT_SIZE;
} }
void separator() void separator(uint16_t _height)
{ {
m_widgetY += DEFAULT_SPACING * 3; m_widgetY += _height;
} }
void separatorLine() void separatorLine(uint16_t _height)
{ {
int32_t xx = m_widgetX; int32_t xx = m_widgetX;
int32_t yy = m_widgetY + DEFAULT_SPACING*2; int32_t yy = m_widgetY + _height/2;
int32_t width = m_widgetW; int32_t width = m_widgetW;
int32_t height = 1; int32_t height = 1;
m_widgetY += DEFAULT_SPACING * 4; m_widgetY += _height;
drawRect( (float)xx drawRect( (float)xx
, (float)yy , (float)yy
@ -2448,14 +2448,14 @@ void imguiUnindent()
s_imgui.unindent(); s_imgui.unindent();
} }
void imguiSeparator() void imguiSeparator(uint16_t _height)
{ {
s_imgui.separator(); s_imgui.separator(_height);
} }
void imguiSeparatorLine() void imguiSeparatorLine(uint16_t _height)
{ {
s_imgui.separatorLine(); s_imgui.separatorLine(_height);
} }
bool imguiButton(const char* _text, bool _enabled) bool imguiButton(const char* _text, bool _enabled)

View File

@ -95,8 +95,8 @@ void imguiEndScrollArea();
void imguiIndent(); void imguiIndent();
void imguiUnindent(); void imguiUnindent();
void imguiSeparator(); void imguiSeparator(uint16_t _height = 12);
void imguiSeparatorLine(); void imguiSeparatorLine(uint16_t _height = 12);
bool imguiButton(const char* _text, bool _enabled = true); bool imguiButton(const char* _text, bool _enabled = true);
bool imguiItem(const char* _text, bool _enabled = true); bool imguiItem(const char* _text, bool _enabled = true);