@ -5214,7 +5214,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
const float text_offset_x = g . FontSize + ( display_frame ? padding . x * 3 : padding . x * 2 ) ; // Collapser arrow width + Spacing
const float text_offset_x = g . FontSize + ( display_frame ? padding . x * 3 : padding . x * 2 ) ; // Collapser arrow width + Spacing
const float text_offset_y = ImMax ( padding . y , window - > DC . CurrLineTextBaseOffset ) ; // Latch before ItemSize changes it
const float text_offset_y = ImMax ( padding . y , window - > DC . CurrLineTextBaseOffset ) ; // Latch before ItemSize changes it
const float text_width = g . FontSize + ( label_size . x > 0.0f ? label_size . x + padding . x * 2 : 0.0f ) ; // Include collapser
const float text_width = g . FontSize + ( label_size . x > 0.0f ? label_size . x + padding . x * 2 : 0.0f ) ; // Include collapser
const ImVec2 text_pos ( window - > DC . CursorPos . x + text_offset_x , window - > DC . CursorPos . y + text_offset_y ) ;
ImVec2 text_pos ( window - > DC . CursorPos . x + text_offset_x , window - > DC . CursorPos . y + text_offset_y ) ;
ItemSize ( ImVec2 ( text_width , frame_height ) , text_offset_y ) ;
ItemSize ( ImVec2 ( text_width , frame_height ) , text_offset_y ) ;
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
// For regular tree nodes, we arbitrary allow to click past 2 worth of ItemSpacing
@ -5307,7 +5307,12 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
const ImU32 bg_col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header ) ;
const ImU32 bg_col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_col , true , style . FrameRounding ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_col , true , style . FrameRounding ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
if ( flags & ImGuiTreeNodeFlags_Bullet )
RenderBullet ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x * 0.60f , text_pos . y + g . FontSize * 0.5f ) , text_col ) ;
else if ( ! is_leaf )
RenderArrow ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x + padding . x , text_pos . y ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
RenderArrow ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x + padding . x , text_pos . y ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
else // Leaf without bullet, left-adjusted text
text_pos . x - = text_offset_x ;
if ( flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton )
if ( flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton )
frame_bb . Max . x - = g . FontSize + style . FramePadding . x ;
frame_bb . Max . x - = g . FontSize + style . FramePadding . x ;
if ( g . LogEnabled )
if ( g . LogEnabled )
@ -5333,11 +5338,10 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_col , false ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_col , false ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
}
}
if ( flags & ImGuiTreeNodeFlags_Bullet )
if ( flags & ImGuiTreeNodeFlags_Bullet )
RenderBullet ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x * 0.5f , text_pos . y + g . FontSize * 0.5 0 f) , text_col ) ;
RenderBullet ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x * 0.5f , text_pos . y + g . FontSize * 0.5 f) , text_col ) ;
else if ( ! is_leaf )
else if ( ! is_leaf )
RenderArrow ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x + padding . x , text_pos . y + g . FontSize * 0.15f ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
RenderArrow ( window - > DrawList , ImVec2 ( text_pos . x - text_offset_x + padding . x , text_pos . y + g . FontSize * 0.15f ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
if ( g . LogEnabled )
if ( g . LogEnabled )
LogRenderedText ( & text_pos , " > " ) ;
LogRenderedText ( & text_pos , " > " ) ;
RenderText ( text_pos , label , label_end , false ) ;
RenderText ( text_pos , label , label_end , false ) ;