@@ -3220,7 +3220,12 @@ class layout_element::reel_component : public component
32203220
32213221 // get the width of the string
32223222 s32 width = font->string_width (ourheight / num_shown, 1 .0f , m_stopnames[fruit]);
3223- float aspect = width > bounds.width () ? (float ) bounds.width () / (float ) width : 1 .0f ;
3223+ float aspect = 1.0 ;
3224+ if (width > bounds.width ())
3225+ {
3226+ aspect = float (bounds.width ()) / float (width);
3227+ width = bounds.width ();
3228+ }
32243229
32253230 float curx = bounds.left () + (bounds.width () - width) / 2 .0f ;
32263231
@@ -3361,7 +3366,12 @@ class layout_element::reel_component : public component
33613366 {
33623367 // get the width of the string
33633368 s32 width = font->string_width (dest.height (), 1 .0f , m_stopnames[fruit]);
3364- float aspect = width > bounds.width () ? (float ) bounds.width () / (float ) width : 1 .0f ;
3369+ float aspect = 1.0 ;
3370+ if (width > bounds.width ())
3371+ {
3372+ aspect = float (bounds.width ()) / float (width);
3373+ width = bounds.width ();
3374+ }
33653375
33663376 float curx = bounds.left ();
33673377
@@ -3702,7 +3712,12 @@ void layout_element::component::draw_text(
37023712{
37033713 // get the width of the string
37043714 s32 width = font.string_width (bounds.height (), 1 .0f , str);
3705- float aspect = (align == 3 || width > bounds.width ()) ? (float ) bounds.width () / (float ) width : 1 .0f ;
3715+ float aspect = 1.0 ;
3716+ if (align == 3 || width > bounds.width ())
3717+ {
3718+ aspect = float (bounds.width ()) / float (width);
3719+ width = bounds.width ();
3720+ }
37063721
37073722 // get alignment
37083723 float curx;
@@ -3715,7 +3730,7 @@ void layout_element::component::draw_text(
37153730
37163731 // right
37173732 case 2 :
3718- curx = bounds.right () - width;
3733+ curx = bounds.left () + bounds. width () - width;
37193734 break ;
37203735
37213736 // stretch
0 commit comments