Browse Source

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

Dario Manesku 11 years ago
parent
commit
9f31587b09
2 changed files with 11 additions and 11 deletions
  1. 9 9
      examples/common/imgui/imgui.cpp
  2. 2 2
      examples/common/imgui/imgui.h

+ 9 - 9
examples/common/imgui/imgui.cpp

@@ -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)

+ 2 - 2
examples/common/imgui/imgui.h

@@ -95,8 +95,8 @@ void imguiEndScrollArea();
 
 
 void imguiIndent();
 void imguiIndent();
 void imguiUnindent();
 void imguiUnindent();
-void imguiSeparator();
-void imguiSeparatorLine();
+void imguiSeparator(uint16_t _height = 12);
+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);