@@ -72,11 +72,11 @@ namespace gmenu {
7272 text.setOrigin (textRect.width / 2 .0f ,0 );
7373 if ( x - textRect.width / 2 .0f < 0 ) {
7474 // std::cout << x << " " << textRect.width / 2.0f;
75- x = textRect.width / 2 + style.Padding .left ;
75+ x = textRect.width / 2 + style.PaddingTitle .left ;
7676 }
7777 if ( x + textRect.width / 2 .0f > window.getSize ().x ) {
7878 // std::cout << x << " " << textRect.width / 2.0f;
79- x = window.getSize ().x - textRect.width /2 + style.Padding .left ;
79+ x = window.getSize ().x - textRect.width /2 + style.PaddingTitle .left ;
8080 }
8181 text.setPosition (sf::Vector2f (x,y));
8282 window.draw (text);
@@ -93,21 +93,22 @@ namespace gmenu {
9393 if ( style.layout & Layout::TitleCentre ) offset_coefficient = 0.5 ;
9494 else if ( style.layout & Layout::TitleLeft ) offset_coefficient = 0.25 ;
9595 else if ( style.layout & Layout::TitleRight ) offset_coefficient = 0.75 ;
96- float x = (float ) window.getSize ().x * offset_coefficient, y = style.Padding .top ;
97- title_location.x = (x + style.Padding .left );
96+ float x = (float ) window.getSize ().x * offset_coefficient, y = style.PaddingTitle .top ;
97+ title_location.x = (x + style.PaddingTitle .left );
9898 title_location.y = y;
9999 std::cout << " title_location:" << title_location.x << " " <<title_location.y <<offset_coefficient<<std::endl;
100100 }
101101
102- unsigned int menu_screen_height =(int ) window.getSize ().y * (1 - style.MenuTitleScaleFactor );
103- unsigned int block_height = (int ) menu_screen_height / menuItems.size () * style.MenuItemScaleFactor ;
102+ unsigned int menu_screen_height =(int ) window.getSize ().y - title_location.y + style.PaddingItems .top ;
103+ std::cout << " Screen hieght" << menu_screen_height << std::endl;
104+ unsigned int block_height = (int ) menu_screen_height/menuItems.size () * style.MenuItemScaleFactor ;
104105
105106 float offset_coefficient = 0.5 ;
106107 if ( style.layout & Layout::ItemCentre ) offset_coefficient = 0.5 ;
107108 else if ( style.layout & Layout::ItemLeft ) offset_coefficient = 0.25 ;
108109 else if ( style.layout & Layout::ItemRight ) offset_coefficient = 0.75 ;
109110
110- float x = (float )window.getSize ().x * offset_coefficient + style.Padding .left ;
111+ float x = (float )window.getSize ().x * offset_coefficient + style.PaddingItems .left ;
111112 float y = ((float )window.getSize ().y ) - 0.75 * menu_screen_height + block_height * 1 / 8 ;
112113 /* Calculating Menu item locations */
113114 for (int8_t i = 0 ; i < menuItems.size (); ++i) {
0 commit comments