@ -6851,7 +6851,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
}
else
{
// Menu inside a menu
// Menu inside a regular/vertical menu
// (In a typical menu window where all items are BeginMenu() or MenuItem() calls, extra_w will always be 0.0f.
// Only when they are other items sticking out we're going to add spacing, yet only register minimum width into the layout system.
popup_pos = ImVec2 ( pos . x , pos . y - style . WindowPadding . y ) ;
@ -7007,10 +7007,11 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
// Note that in this situation: we don't render the shortcut, we render a highlight instead of the selected tick mark.
float w = label_size . x ;
window - > DC . CursorPos . x + = IM_FLOOR ( style . ItemSpacing . x * 0.5f ) ;
ImVec2 text_pos ( window - > DC . CursorPos . x + offsets - > OffsetLabel , window - > DC . CursorPos . y + window - > DC . CurrLineTextBaseOffset ) ;
PushStyleVar ( ImGuiStyleVar_ItemSpacing , ImVec2 ( style . ItemSpacing . x * 2.0f , style . ItemSpacing . y ) ) ;
pressed = Selectable ( " " , selected , flags , ImVec2 ( w , 0.0f ) ) ;
PopStyleVar ( ) ;
RenderText ( pos + ImVec2 ( offsets - > OffsetLabel , 0.0f ) , label ) ;
RenderText ( text_pos , label ) ;
window - > DC . CursorPos . x + = IM_FLOOR ( style . ItemSpacing . x * ( - 1.0f + 0.5f ) ) ; // -1 spacing to compensate the spacing added when Selectable() did a SameLine(). It would also work to call SameLine() ourselves after the PopStyleVar().
}
else