@ -4270,13 +4270,11 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
flags | = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize ;
flags | = ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize ;
// Find or create
// Find or create
bool window_is_new = false ;
ImGuiWindow * window = FindWindowByName ( name ) ;
ImGuiWindow * window = FindWindowByName ( name ) ;
if ( ! window )
if ( ! window )
{
{
ImVec2 size_on_first_use = ( g . SetNextWindowSizeCond ! = 0 ) ? g . SetNextWindowSizeVal : ImVec2 ( 0.0f , 0.0f ) ; // Any condition flag will do since we are creating a new window here.
ImVec2 size_on_first_use = ( g . SetNextWindowSizeCond ! = 0 ) ? g . SetNextWindowSizeVal : ImVec2 ( 0.0f , 0.0f ) ; // Any condition flag will do since we are creating a new window here.
window = CreateNewWindow ( name , size_on_first_use , flags ) ;
window = CreateNewWindow ( name , size_on_first_use , flags ) ;
window_is_new = true ;
}
}
const int current_frame = g . FrameCount ;
const int current_frame = g . FrameCount ;
@ -4420,8 +4418,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// SIZE
// SIZE
// Update contents size from last frame for auto-fitting (unless explicitly specified)
// Update contents size from last frame for auto-fitting (unless explicitly specified)
window - > SizeContents . x = ( float ) ( int ) ( ( window - > SizeContentsExplicit . x ! = 0.0f ) ? window - > SizeContentsExplicit . x : ( ( window_is_new ? 0.0f : window - > DC . CursorMaxPos . x - window - > Pos . x ) + window - > Scroll . x ) ) ;
window - > SizeContents . x = ( float ) ( int ) ( ( window - > SizeContentsExplicit . x ! = 0.0f ) ? window - > SizeContentsExplicit . x : ( window - > DC . CursorMaxPos . x - window - > Pos . x + window - > Scroll . x ) ) ;
window - > SizeContents . y = ( float ) ( int ) ( ( window - > SizeContentsExplicit . y ! = 0.0f ) ? window - > SizeContentsExplicit . y : ( ( window_is_new ? 0.0f : window - > DC . CursorMaxPos . y - window - > Pos . y ) + window - > Scroll . y ) ) ;
window - > SizeContents . y = ( float ) ( int ) ( ( window - > SizeContentsExplicit . y ! = 0.0f ) ? window - > SizeContentsExplicit . y : ( window - > DC . CursorMaxPos . y - window - > Pos . y + window - > Scroll . y ) ) ;
window - > SizeContents + = window - > WindowPadding ;
window - > SizeContents + = window - > WindowPadding ;
// Hide popup/tooltip window when re-opening while we measure size (because we recycle the windows)
// Hide popup/tooltip window when re-opening while we measure size (because we recycle the windows)