From 9f31587b09a827d6fa52bff296b459b8575993b1 Mon Sep 17 00:00:00 2001 From: Dario Manesku Date: Sun, 10 Aug 2014 15:22:24 +0100 Subject: [PATCH] Added optional _height param for imguiSeparator() and imguiSeparatorLine(). --- examples/common/imgui/imgui.cpp | 18 +++++++++--------- examples/common/imgui/imgui.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/examples/common/imgui/imgui.cpp b/examples/common/imgui/imgui.cpp index a658468e1..dd496d805 100644 --- a/examples/common/imgui/imgui.cpp +++ b/examples/common/imgui/imgui.cpp @@ -1529,18 +1529,18 @@ struct Imgui 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 yy = m_widgetY + DEFAULT_SPACING*2; + int32_t yy = m_widgetY + _height/2; int32_t width = m_widgetW; int32_t height = 1; - m_widgetY += DEFAULT_SPACING * 4; + m_widgetY += _height; drawRect( (float)xx , (float)yy @@ -2448,14 +2448,14 @@ void imguiUnindent() 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) diff --git a/examples/common/imgui/imgui.h b/examples/common/imgui/imgui.h index d3ef25d07..1bd0b7f9b 100644 --- a/examples/common/imgui/imgui.h +++ b/examples/common/imgui/imgui.h @@ -95,8 +95,8 @@ void imguiEndScrollArea(); void imguiIndent(); 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 imguiItem(const char* _text, bool _enabled = true);