@ -9879,23 +9879,22 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
// Horizontal separating line.
// Horizontal separating line.
void ImGui : : Separator ( )
void ImGui : : Separator ( )
{
{
ImGuiContext & g = * GImGui ;
ImGuiWindow * window = GetCurrentWindow ( ) ;
ImGuiWindow * window = GetCurrentWindow ( ) ;
if ( window - > SkipItems )
if ( window - > SkipItems )
return ;
return ;
ImGuiContext & g = * GImGui ;
ImGuiWindowFlags flags = 0 ;
ImGuiWindowFlags flags = 0 ;
if ( ( flags & ( ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical ) ) = = 0 )
if ( ( flags & ( ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical ) ) = = 0 )
flags | = ( window - > DC . LayoutType = = ImGuiLayoutType_Horizontal ) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal ;
IM_ASSERT ( ImIsPowerOfTwo ( ( int ) ( flags & ( ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical ) ) ) ) ; // Check that only 1 option is selected
if ( flags & ImGuiSeparatorFlags_Vertical )
{
{
if ( window - > DC . LayoutType = = ImGuiLayoutType_Horizontal )
VerticalSeparator ( ) ;
flags | = ImGuiSeparatorFlags_Vertical ;
return ;
else
flags | = ImGuiSeparatorFlags_Horizontal ;
}
}
IM_ASSERT ( ImIsPowerOfTwo ( ( int ) ( flags & ( ImGuiSeparatorFlags_Horizontal | ImGuiSeparatorFlags_Vertical ) ) ) ) ; // Check that only 1 option is selected
if ( flags & ImGuiSeparatorFlags_Horizontal )
// Horizontal Separator
{
if ( window - > DC . ColumnsCount > 1 )
if ( window - > DC . ColumnsCount > 1 )
PopClipRect ( ) ;
PopClipRect ( ) ;
@ -9923,19 +9922,25 @@ void ImGui::Separator()
PushColumnClipRect ( ) ;
PushColumnClipRect ( ) ;
window - > DC . ColumnsCellMinY = window - > DC . CursorPos . y ;
window - > DC . ColumnsCellMinY = window - > DC . CursorPos . y ;
}
}
}
}
else if ( flags & ImGuiSeparatorFlags_Vertical )
{
void ImGui : : VerticalSeparator ( )
const ImRect bb ( window - > DC . CursorPos , window - > DC . CursorPos + ImVec2 ( 1.0f , window - > DC . CurrentLineHeight ) ) ;
{
ImGuiWindow * window = GetCurrentWindow ( ) ;
if ( window - > SkipItems )
return ;
ImGuiContext & g = * GImGui ;
float y1 = window - > DC . CursorPos . y ;
float y2 = window - > DC . CursorPos . y + window - > DC . CurrentLineHeight ;
const ImRect bb ( ImVec2 ( window - > DC . CursorPos . x , y1 ) , ImVec2 ( window - > DC . CursorPos . x + 1.0f , y2 ) ) ;
ItemSize ( ImVec2 ( bb . GetWidth ( ) , 0.0f ) ) ;
ItemSize ( ImVec2 ( bb . GetWidth ( ) , 0.0f ) ) ;
if ( ! ItemAdd ( bb , NULL ) )
if ( ! ItemAdd ( bb , NULL ) )
return ;
return ;
window - > DrawList - > AddLine ( ImVec2 ( bb . Min . x , bb . Min . y ) , ImVec2 ( bb . Min . x , bb . Max . y ) , GetColorU32 ( ImGuiCol_Separator ) ) ;
window - > DrawList - > AddLine ( ImVec2 ( bb . Min . x , bb . Min . y ) , ImVec2 ( bb . Min . x , bb . Max . y ) , GetColorU32 ( ImGuiCol_Separator ) ) ;
if ( g . LogEnabled )
if ( g . LogEnabled )
LogText ( " | " ) ;
LogText ( " | " ) ;
}
}
}
void ImGui : : Spacing ( )
void ImGui : : Spacing ( )