Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/emu/rendlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3220,7 +3220,12 @@ class layout_element::reel_component : public component

// get the width of the string
s32 width = font->string_width(ourheight / num_shown, 1.0f, m_stopnames[fruit]);
float aspect = width > bounds.width() ? (float) bounds.width() / (float) width : 1.0f;
float aspect = 1.0;
if (width > bounds.width())
{
aspect = float(bounds.width()) / float(width);
width = bounds.width();
}

float curx = bounds.left() + (bounds.width() - width) / 2.0f;

Expand Down Expand Up @@ -3361,7 +3366,12 @@ class layout_element::reel_component : public component
{
// get the width of the string
s32 width = font->string_width(dest.height(), 1.0f, m_stopnames[fruit]);
float aspect = width > bounds.width() ? (float) bounds.width() / (float) width : 1.0f;
float aspect = 1.0;
if (width > bounds.width())
{
aspect = float(bounds.width()) / float(width);
width = bounds.width();
}

float curx = bounds.left();

Expand Down Expand Up @@ -3702,7 +3712,12 @@ void layout_element::component::draw_text(
{
// get the width of the string
s32 width = font.string_width(bounds.height(), 1.0f, str);
float aspect = (align == 3 || width > bounds.width()) ? (float) bounds.width() / (float) width : 1.0f;
float aspect = 1.0;
if (align == 3 || width > bounds.width())
{
aspect = float(bounds.width()) / float(width);
width = bounds.width();
}

// get alignment
float curx;
Expand All @@ -3715,7 +3730,7 @@ void layout_element::component::draw_text(

// right
case 2:
curx = bounds.right() - width;
curx = bounds.left() + bounds.width() - width;
break;

// stretch
Expand Down
Loading