@ -4130,7 +4130,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImVec2 size, ImGuiWindowFl 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    return  window ;   
					 
					 
					 
					    return  window ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					static  ImVec2  CalcSizeFullWith Constraint ( ImGuiWindow *  window ,  ImVec2  new_size )  
					 
					 
					 
					static  ImVec2  CalcSizeAfter Constraint ( ImGuiWindow *  window ,  ImVec2  new_size )  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					{  
					 
					 
					 
					{  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImGuiContext &  g  =  * GImGui ;   
					 
					 
					 
					    ImGuiContext &  g  =  * GImGui ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    if  ( g . SetNextWindowSizeConstraint )   
					 
					 
					 
					    if  ( g . SetNextWindowSizeConstraint )   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -4168,7 +4168,7 @@ static ImVec2 CalcSizeContents(ImGuiWindow* window) 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    return  sz  +  window - > WindowPadding ;   
					 
					 
					 
					    return  sz  +  window - > WindowPadding ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					}  
					 
					 
					 
					}  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					static  ImVec2  CalcSizeAutoFit ( ImGuiWindow *  window )  
					 
					 
					 
					static  ImVec2  CalcSizeAutoFit ( ImGuiWindow *  window ,  const  ImVec2 &  size_contents )  
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					{  
					 
					 
					 
					{  
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImGuiContext &  g  =  * GImGui ;   
					 
					 
					 
					    ImGuiContext &  g  =  * GImGui ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImGuiStyle &  style  =  g . Style ;   
					 
					 
					 
					    ImGuiStyle &  style  =  g . Style ;   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -4177,16 +4177,16 @@ static ImVec2 CalcSizeAutoFit(ImGuiWindow* window) 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    if  ( ( flags  &  ImGuiWindowFlags_Tooltip )  ! =  0 )   
					 
					 
					 
					    if  ( ( flags  &  ImGuiWindowFlags_Tooltip )  ! =  0 )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    {   
					 
					 
					 
					    {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        // Tooltip always resize. We keep the spacing symmetric on both axises for aesthetic purpose.
   
					 
					 
					 
					        // Tooltip always resize. We keep the spacing symmetric on both axises for aesthetic purpose.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        size_auto_fit  =  window - > SizeC ontents;   
					 
					 
					 
					        size_auto_fit  =  size_c ontents;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					    }   
					 
					 
					 
					    }   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    else   
					 
					 
					 
					    else   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    {   
					 
					 
					 
					    {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        // Handling case of auto fit window not fitting on the screen (on either axis): we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
   
					 
					 
					 
					        // Handling case of auto fit window not fitting on the screen (on either axis): we are growing the size on the other axis to compensate for expected scrollbar. FIXME: Might turn bigger than DisplaySize-WindowPadding.
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        size_auto_fit  =  ImClamp ( window - > SizeC ontents,  style . WindowMinSize ,  ImMax ( style . WindowMinSize ,  g . IO . DisplaySize  -  g . Style . DisplaySafeAreaPadding ) ) ;   
					 
					 
					 
					        size_auto_fit  =  ImClamp ( size_c ontents,  style . WindowMinSize ,  ImMax ( style . WindowMinSize ,  g . IO . DisplaySize  -  g . Style . DisplaySafeAreaPadding ) ) ;   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        ImVec2  size_auto_fit_after_constraint  =  CalcSizeFullWith Constraint ( window ,  size_auto_fit ) ;   
					 
					 
					 
					        ImVec2  size_auto_fit_after_constraint  =  CalcSizeAfter Constraint ( window ,  size_auto_fit ) ;   
				
			 
			
				
				
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( size_auto_fit_after_constraint . x  <  window - > SizeC ontents. x  & &  ! ( flags  &  ImGuiWindowFlags_NoScrollbar )  & &  ( flags  &  ImGuiWindowFlags_HorizontalScrollbar ) )   
					 
					 
					 
					        if  ( size_auto_fit_after_constraint . x  <  size_c ontents. x  & &  ! ( flags  &  ImGuiWindowFlags_NoScrollbar )  & &  ( flags  &  ImGuiWindowFlags_HorizontalScrollbar ) )   
				
			 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					            size_auto_fit . y  + =  style . ScrollbarSize ;   
					 
					 
					 
					            size_auto_fit . y  + =  style . ScrollbarSize ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( size_auto_fit_after_constraint . y  <  window - > SizeC ontents. y  & &  ! ( flags  &  ImGuiWindowFlags_NoScrollbar ) )   
					 
					 
					 
					        if  ( size_auto_fit_after_constraint . y  <  size_c ontents. y  & &  ! ( flags  &  ImGuiWindowFlags_NoScrollbar ) )   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					            size_auto_fit . x  + =  style . ScrollbarSize ;   
					 
					 
					 
					            size_auto_fit . x  + =  style . ScrollbarSize ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    }   
					 
					 
					 
					    }   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    return  size_auto_fit ;   
					 
					 
					 
					    return  size_auto_fit ;   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -4234,7 +4234,7 @@ static void CalcResizePosSizeFromAnyCorner(ImGuiWindow* window, const ImVec2& co 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImVec2  pos_min  =  ImLerp ( corner_target ,  window - > Pos ,  corner_norm ) ;                 // Expected window upper-left
   
					 
					 
					 
					    ImVec2  pos_min  =  ImLerp ( corner_target ,  window - > Pos ,  corner_norm ) ;                 // Expected window upper-left
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImVec2  pos_max  =  ImLerp ( window - > Pos  +  window - > Size ,  corner_target ,  corner_norm ) ;  // Expected window lower-right
   
					 
					 
					 
					    ImVec2  pos_max  =  ImLerp ( window - > Pos  +  window - > Size ,  corner_target ,  corner_norm ) ;  // Expected window lower-right
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImVec2  size_expected  =  pos_max  -  pos_min ;   
					 
					 
					 
					    ImVec2  size_expected  =  pos_max  -  pos_min ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    ImVec2  size_constrained  =  CalcSizeFullWith Constraint ( window ,  size_expected ) ;   
					 
					 
					 
					    ImVec2  size_constrained  =  CalcSizeAfter Constraint ( window ,  size_expected ) ;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					    * out_pos  =  pos_min ;   
					 
					 
					 
					    * out_pos  =  pos_min ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					    if  ( corner_norm . x  = =  0.0f )   
					 
					 
					 
					    if  ( corner_norm . x  = =  0.0f )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        out_pos - > x  - =  ( size_constrained . x  -  size_expected . x ) ;   
					 
					 
					 
					        out_pos - > x  - =  ( size_constrained . x  -  size_expected . x ) ;   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -4465,7 +4465,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        const  float  window_border_size  =  window - > WindowBorderSize ;   
					 
					 
					 
					        const  float  window_border_size  =  window - > WindowBorderSize ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        // Calculate auto-fit size, handle automatic resize
   
					 
					 
					 
					        // Calculate auto-fit size, handle automatic resize
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        const  ImVec2  size_auto_fit  =  CalcSizeAutoFit ( window ) ;   
					 
					 
					 
					        const  ImVec2  size_auto_fit  =  CalcSizeAutoFit ( window ,  window - > SizeContents ) ;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					        ImVec2  size_full_modified ( FLT_MAX ,  FLT_MAX ) ;   
					 
					 
					 
					        ImVec2  size_full_modified ( FLT_MAX ,  FLT_MAX ) ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( flags  &  ImGuiWindowFlags_AlwaysAutoResize  & &  ! window - > Collapsed )   
					 
					 
					 
					        if  ( flags  &  ImGuiWindowFlags_AlwaysAutoResize  & &  ! window - > Collapsed )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        {   
					 
					 
					 
					        {   
				
			 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
							 
						
					 
					 
					@ -4488,7 +4488,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        }   
					 
					 
					 
					        }   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					
 
					 
					 
					 
					
 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        // Apply minimum/maximum window size constraints and final size
   
					 
					 
					 
					        // Apply minimum/maximum window size constraints and final size
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        window - > SizeFull  =  CalcSizeFullWith Constraint ( window ,  window - > SizeFull ) ;   
					 
					 
					 
					        window - > SizeFull  =  CalcSizeAfter Constraint ( window ,  window - > SizeFull ) ;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					        window - > Size  =  window - > Collapsed  ?  window - > TitleBarRect ( ) . GetSize ( )  :  window - > SizeFull ;   
					 
					 
					 
					        window - > Size  =  window - > Collapsed  ?  window - > TitleBarRect ( ) . GetSize ( )  :  window - > SizeFull ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        if  ( ( flags  &  ImGuiWindowFlags_ChildWindow )  & &  ! ( flags  &  ImGuiWindowFlags_Popup ) )   
					 
					 
					 
					        if  ( ( flags  &  ImGuiWindowFlags_ChildWindow )  & &  ! ( flags  &  ImGuiWindowFlags_Popup ) )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					        {   
					 
					 
					 
					        {   
				
			 
			
		
	
	
		
		
			
				
					
						
							
								 
							 
						
						
							
								 
							 
						
						
					 
					 
					@ -4638,7 +4638,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags) 
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                    if  ( g . HoveredWindow  = =  window  & &  held  & &  g . IO . MouseDoubleClicked [ 0 ]  & &  resize_grip_n  = =  0 )   
					 
					 
					 
					                    if  ( g . HoveredWindow  = =  window  & &  held  & &  g . IO . MouseDoubleClicked [ 0 ]  & &  resize_grip_n  = =  0 )   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                    {   
					 
					 
					 
					                    {   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        // Manual auto-fit when double-clicking
   
					 
					 
					 
					                        // Manual auto-fit when double-clicking
   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                        size_target  =  CalcSizeFullWith Constraint ( window ,  size_auto_fit ) ;   
					 
					 
					 
					                        size_target  =  CalcSizeAfter Constraint ( window ,  size_auto_fit ) ;   
				
			 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 
					 
					 
					                        ClearActiveID ( ) ;   
					 
					 
					 
					                        ClearActiveID ( ) ;   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                    }   
					 
					 
					 
					                    }   
				
			 
			
		
	
		
		
			
				
					
					 
					 
					 
					                    else  if  ( held )   
					 
					 
					 
					                    else  if  ( held )