File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -525,6 +525,9 @@ void menu::draw(uint32_t flags)
525
525
{
526
526
heading_layout.emplace (create_layout (max_width - (gutter_width () * 2 .0F ), text_layout::text_justify::CENTER));
527
527
heading_layout->add_text (*m_heading, ui ().colors ().text_color ());
528
+
529
+ // readjust visible width if heading width exceeds that of the menu
530
+ visible_width = std::max (gutter_width () + heading_layout->actual_width () + gutter_width (), visible_width);
528
531
}
529
532
530
533
// account for extra space at the top and bottom
@@ -558,17 +561,14 @@ void menu::draw(uint32_t flags)
558
561
{
559
562
if (heading_layout)
560
563
{
561
- float const heading_width = heading_layout->actual_width ();
562
- float const heading_left = (1 .0F - heading_width) * 0 .5F ;
563
- float const hx1 = std::min (x1, heading_left - gutter_width () - lr_border ());
564
- float const hx2 = std::max (x2, heading_left + heading_width + gutter_width () + lr_border ());
565
564
ui ().draw_outlined_box (
566
565
container (),
567
- hx1 , y1 - top_extra_menu_height,
568
- hx2 , y1 - m_customtop - tb_border (),
566
+ x1 , y1 - top_extra_menu_height,
567
+ x2 , y1 - m_customtop - tb_border (),
569
568
UI_GREEN_COLOR);
570
569
heading_layout->emit (container (), (1 .0F - heading_layout->width ()) * 0 .5F , y1 - top_extra_menu_height + tb_border ());
571
570
}
571
+
572
572
ui ().draw_outlined_box (
573
573
container (),
574
574
x1, y1 ,
You can’t perform that action at this time.
0 commit comments