@ -3084,8 +3084,8 @@ void ImGui::RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border,
const float border_size = g . Style . FrameBorderSize ;
if ( border & & border_size > 0.0f )
{
window - > DrawList - > AddRect ( p_min + ImVec2 ( 1 , 1 ) , p_max + ImVec2 ( 1 , 1 ) , GetColorU32 ( ImGuiCol_BorderShadow ) , rounding , ~ 0 , border_size ) ;
window - > DrawList - > AddRect ( p_min , p_max , GetColorU32 ( ImGuiCol_Border ) , rounding , ~ 0 , border_size ) ;
window - > DrawList - > AddRect ( p_min + ImVec2 ( 1 , 1 ) , p_max + ImVec2 ( 1 , 1 ) , GetColorU32 ( ImGuiCol_BorderShadow ) , rounding , ImDrawCornerFlags_All , border_size ) ;
window - > DrawList - > AddRect ( p_min , p_max , GetColorU32 ( ImGuiCol_Border ) , rounding , ImDrawCornerFlags_All , border_size ) ;
}
}
@ -3096,8 +3096,8 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
const float border_size = g . Style . FrameBorderSize ;
if ( border_size > 0.0f )
{
window - > DrawList - > AddRect ( p_min + ImVec2 ( 1 , 1 ) , p_max + ImVec2 ( 1 , 1 ) , GetColorU32 ( ImGuiCol_BorderShadow ) , rounding , ~ 0 , border_size ) ;
window - > DrawList - > AddRect ( p_min , p_max , GetColorU32 ( ImGuiCol_Border ) , rounding , ~ 0 , border_size ) ;
window - > DrawList - > AddRect ( p_min + ImVec2 ( 1 , 1 ) , p_max + ImVec2 ( 1 , 1 ) , GetColorU32 ( ImGuiCol_BorderShadow ) , rounding , ImDrawCornerFlags_All , border_size ) ;
window - > DrawList - > AddRect ( p_min , p_max , GetColorU32 ( ImGuiCol_Border ) , rounding , ImDrawCornerFlags_All , border_size ) ;
}
}
@ -4458,18 +4458,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Window background, Default Alpha
ImU32 bg_col = GetColorU32 ( GetWindowBgColorIdxFromFlags ( flags ) ) ;
window - > DrawList - > AddRectFilled ( window - > Pos + ImVec2 ( 0 , window - > TitleBarHeight ( ) ) , window - > Pos + window - > Size , bg_col , window_rounding , ( flags & ImGuiWindowFlags_NoTitleBar ) ? Im GuiCorner_All : ImGuiCorner_BotLeft | ImGuiCorner_BotRigh t) ;
window - > DrawList - > AddRectFilled ( window - > Pos + ImVec2 ( 0 , window - > TitleBarHeight ( ) ) , window - > Pos + window - > Size , bg_col , window_rounding , ( flags & ImGuiWindowFlags_NoTitleBar ) ? Im DrawCornerFlags_All : ImDrawCornerFlags_Bo t) ;
// Title bar
const bool is_focused = g . NavWindow & & window - > RootNonPopupWindow = = g . NavWindow - > RootNonPopupWindow ;
if ( ! ( flags & ImGuiWindowFlags_NoTitleBar ) )
window - > DrawList - > AddRectFilled ( title_bar_rect . GetTL ( ) , title_bar_rect . GetBR ( ) , GetColorU32 ( is_focused ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg ) , window_rounding , Im GuiCorner_TopLeft| ImGuiCorner_TopRight ) ;
window - > DrawList - > AddRectFilled ( title_bar_rect . GetTL ( ) , title_bar_rect . GetBR ( ) , GetColorU32 ( is_focused ? ImGuiCol_TitleBgActive : ImGuiCol_TitleBg ) , window_rounding , Im DrawCornerFlags_Top ) ;
// Menu bar
if ( flags & ImGuiWindowFlags_MenuBar )
{
ImRect menu_bar_rect = window - > MenuBarRect ( ) ;
window - > DrawList - > AddRectFilled ( menu_bar_rect . GetTL ( ) , menu_bar_rect . GetBR ( ) , GetColorU32 ( ImGuiCol_MenuBarBg ) , ( flags & ImGuiWindowFlags_NoTitleBar ) ? window_rounding : 0.0f , Im GuiCorner_TopLeft| ImGuiCorner_TopRight ) ;
window - > DrawList - > AddRectFilled ( menu_bar_rect . GetTL ( ) , menu_bar_rect . GetBR ( ) , GetColorU32 ( ImGuiCol_MenuBarBg ) , ( flags & ImGuiWindowFlags_NoTitleBar ) ? window_rounding : 0.0f , Im DrawCornerFlags_Top ) ;
if ( style . FrameBorderSize > 0.0f )
window - > DrawList - > AddLine ( menu_bar_rect . GetBL ( ) , menu_bar_rect . GetBR ( ) , GetColorU32 ( ImGuiCol_Border ) , style . FrameBorderSize ) ;
}
@ -4493,7 +4493,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Borders
if ( window_border_size > 0.0f )
window - > DrawList - > AddRect ( window - > Pos , window - > Pos + window - > Size , GetColorU32 ( ImGuiCol_Border ) , window_rounding , ~ 0 , window_border_size ) ;
window - > DrawList - > AddRect ( window - > Pos , window - > Pos + window - > Size , GetColorU32 ( ImGuiCol_Border ) , window_rounding , ImDrawCornerFlags_All , window_border_size ) ;
if ( style . FrameBorderSize > 0 & & ! ( flags & ImGuiWindowFlags_NoTitleBar ) )
window - > DrawList - > AddLine ( title_bar_rect . GetBL ( ) + ImVec2 ( 1 , - 1 ) , title_bar_rect . GetBR ( ) + ImVec2 ( - 1 , - 1 ) , GetColorU32 ( ImGuiCol_Border ) , style . FrameBorderSize ) ;
}
@ -4730,9 +4730,9 @@ void ImGui::Scrollbar(ImGuiLayoutType direction)
int window_rounding_corners ;
if ( horizontal )
window_rounding_corners = Im GuiCorner_BotLeft | ( other_scrollbar ? 0 : ImGuiCorner _BotRight) ;
window_rounding_corners = Im DrawCornerFlags_BotLeft | ( other_scrollbar ? 0 : ImDrawCornerFlags _BotRight) ;
else
window_rounding_corners = ( ( ( window - > Flags & ImGuiWindowFlags_NoTitleBar ) & & ! ( window - > Flags & ImGuiWindowFlags_MenuBar ) ) ? Im GuiCorner _TopRight : 0 ) | ( other_scrollbar ? 0 : Im GuiCorner _BotRight) ;
window_rounding_corners = ( ( ( window - > Flags & ImGuiWindowFlags_NoTitleBar ) & & ! ( window - > Flags & ImGuiWindowFlags_MenuBar ) ) ? Im DrawCornerFlags _TopRight : 0 ) | ( other_scrollbar ? 0 : Im DrawCornerFlags _BotRight) ;
window - > DrawList - > AddRectFilled ( bb . Min , bb . Max , GetColorU32 ( ImGuiCol_ScrollbarBg ) , window - > WindowRounding , window_rounding_corners ) ;
bb . Expand ( ImVec2 ( - ImClamp ( ( float ) ( int ) ( ( bb . Max . x - bb . Min . x - 2.0f ) * 0.5f ) , 0.0f , 3.0f ) , - ImClamp ( ( float ) ( int ) ( ( bb . Max . y - bb . Min . y - 2.0f ) * 0.5f ) , 0.0f , 3.0f ) ) ) ;
@ -9440,8 +9440,8 @@ void ImGui::RenderColorRectWithAlphaCheckerboard(ImVec2 p_min, ImVec2 p_max, ImU
if ( x2 < = x1 )
continue ;
int rounding_corners_flags_cell = 0 ;
if ( y1 < = p_min . y ) { if ( x1 < = p_min . x ) rounding_corners_flags_cell | = Im GuiCorner_TopLeft; if ( x2 > = p_max . x ) rounding_corners_flags_cell | = Im GuiCorner _TopRight; }
if ( y2 > = p_max . y ) { if ( x1 < = p_min . x ) rounding_corners_flags_cell | = Im GuiCorner _BotLeft; if ( x2 > = p_max . x ) rounding_corners_flags_cell | = Im GuiCorner _BotRight; }
if ( y1 < = p_min . y ) { if ( x1 < = p_min . x ) rounding_corners_flags_cell | = Im DrawCornerFlags_TopLeft; if ( x2 > = p_max . x ) rounding_corners_flags_cell | = Im DrawCornerFlags _TopRight; }
if ( y2 > = p_max . y ) { if ( x1 < = p_min . x ) rounding_corners_flags_cell | = Im DrawCornerFlags _BotLeft; if ( x2 > = p_max . x ) rounding_corners_flags_cell | = Im DrawCornerFlags _BotRight; }
rounding_corners_flags_cell & = rounding_corners_flags ;
window - > DrawList - > AddRectFilled ( ImVec2 ( x1 , y1 ) , ImVec2 ( x2 , y2 ) , col_bg2 , rounding_corners_flags_cell ? rounding : 0.0f , rounding_corners_flags_cell ) ;
}
@ -9504,8 +9504,8 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
if ( ( flags & ImGuiColorEditFlags_AlphaPreviewHalf ) & & col . w < 1.0f )
{
float mid_x = ( float ) ( int ) ( ( bb_inner . Min . x + bb_inner . Max . x ) * 0.5f + 0.5f ) ;
RenderColorRectWithAlphaCheckerboard ( ImVec2 ( bb_inner . Min . x + grid_step , bb_inner . Min . y ) , bb_inner . Max , GetColorU32 ( col ) , grid_step , ImVec2 ( - grid_step + off , off ) , rounding , Im GuiCorner_TopRight| ImGuiCorner _BotRight) ;
window - > DrawList - > AddRectFilled ( bb_inner . Min , ImVec2 ( mid_x , bb_inner . Max . y ) , GetColorU32 ( col_without_alpha ) , rounding , Im GuiCorner_TopLeft| ImGuiCorner _BotLeft) ;
RenderColorRectWithAlphaCheckerboard ( ImVec2 ( bb_inner . Min . x + grid_step , bb_inner . Min . y ) , bb_inner . Max , GetColorU32 ( col ) , grid_step , ImVec2 ( - grid_step + off , off ) , rounding , Im DrawCornerFlags_TopRight| ImDrawCornerFlags _BotRight) ;
window - > DrawList - > AddRectFilled ( bb_inner . Min , ImVec2 ( mid_x , bb_inner . Max . y ) , GetColorU32 ( col_without_alpha ) , rounding , Im DrawCornerFlags_TopLeft| ImDrawCornerFlags _BotLeft) ;
}
else
{
@ -9514,7 +9514,7 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
if ( col_source . w < 1.0f )
RenderColorRectWithAlphaCheckerboard ( bb_inner . Min , bb_inner . Max , GetColorU32 ( col_source ) , grid_step , ImVec2 ( off , off ) , rounding ) ;
else
window - > DrawList - > AddRectFilled ( bb_inner . Min , bb_inner . Max , GetColorU32 ( col_source ) , rounding , ~ 0 ) ;
window - > DrawList - > AddRectFilled ( bb_inner . Min , bb_inner . Max , GetColorU32 ( col_source ) , rounding , ImDrawCornerFlags_All ) ;
}
if ( g . Style . FrameBorderSize > 0.0f )
RenderFrameBorder ( bb . Min , bb . Max , rounding ) ;