From badb709503679706d35dc0d1e60b851afd0a12d3 Mon Sep 17 00:00:00 2001 From: dankan1890 Date: Sun, 19 Jun 2016 23:37:01 +0200 Subject: [PATCH] Proper placement of toolbar icons. (nw) --- src/frontend/mame/ui/menu.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/mame/ui/menu.cpp b/src/frontend/mame/ui/menu.cpp index bf936e7b779..6fe6f2cd67e 100644 --- a/src/frontend/mame/ui/menu.cpp +++ b/src/frontend/mame/ui/menu.cpp @@ -2274,9 +2274,9 @@ void menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software) for (auto & e : t_bitmap) if (e->valid()) m_valid++; - float space_x = (y2 - y1) * container->manager().ui_aspect(); - float total = (m_valid * space_x) + ((m_valid - 1) * 0.001f); - x1 = ((x2 - x1) * 0.5f) - (total / 2); + float space_x = (y2 - y1) * container->manager().ui_aspect(container); + auto total = (float)(m_valid * space_x) + ((float)(m_valid - 1) * 0.001f); + x1 += (x2 - x1) * 0.5f - total * 0.5f; x2 = x1 + space_x; for (int z = 0; z < UI_TOOLBAR_BUTTONS; ++z)