2
0
Эх сурвалжийг харах

Added optional parameters for imguiIndent().

Dario Manesku 11 жил өмнө
parent
commit
b18e29a930

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

@@ -1517,16 +1517,16 @@ struct Imgui
 		return res || valChanged;
 		return res || valChanged;
 	}
 	}
 
 
-	void indent()
+	void indent(uint16_t _width)
 	{
 	{
-		m_widgetX += INDENT_SIZE;
-		m_widgetW -= INDENT_SIZE;
+		m_widgetX += _width;
+		m_widgetW -= _width;
 	}
 	}
 
 
-	void unindent()
+	void unindent(uint16_t _width)
 	{
 	{
-		m_widgetX -= INDENT_SIZE;
-		m_widgetW += INDENT_SIZE;
+		m_widgetX -= _width;
+		m_widgetW += _width;
 	}
 	}
 
 
 	void separator(uint16_t _height)
 	void separator(uint16_t _height)
@@ -2438,14 +2438,14 @@ void imguiEndScrollArea()
 	s_imgui.endScrollArea();
 	s_imgui.endScrollArea();
 }
 }
 
 
-void imguiIndent()
+void imguiIndent(uint16_t _width)
 {
 {
-	s_imgui.indent();
+	s_imgui.indent(_width);
 }
 }
 
 
-void imguiUnindent()
+void imguiUnindent(uint16_t _width)
 {
 {
-	s_imgui.unindent();
+	s_imgui.unindent(_width);
 }
 }
 
 
 void imguiSeparator(uint16_t _height)
 void imguiSeparator(uint16_t _height)

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

@@ -93,8 +93,8 @@ bool imguiBorderButton(ImguiBorder::Enum _border, bool _checked, bool _enabled =
 bool imguiBeginScrollArea(const char* _name, int _x, int _y, int _width, int _height, int* _scroll, bool _enabled = true);
 bool imguiBeginScrollArea(const char* _name, int _x, int _y, int _width, int _height, int* _scroll, bool _enabled = true);
 void imguiEndScrollArea();
 void imguiEndScrollArea();
 
 
-void imguiIndent();
-void imguiUnindent();
+void imguiIndent(uint16_t _width = 16);
+void imguiUnindent(uint16_t _width = 16);
 void imguiSeparator(uint16_t _height = 12);
 void imguiSeparator(uint16_t _height = 12);
 void imguiSeparatorLine(uint16_t _height = 12);
 void imguiSeparatorLine(uint16_t _height = 12);