Proper placement of toolbar icons. (nw)

This commit is contained in:
dankan1890 2016-06-19 23:37:01 +02:00
parent 1c3a6595ff
commit badb709503

View File

@ -2274,9 +2274,9 @@ void menu::draw_toolbar(float x1, float y1, float x2, float y2, bool software)
for (auto & e : t_bitmap) for (auto & e : t_bitmap)
if (e->valid()) m_valid++; if (e->valid()) m_valid++;
float space_x = (y2 - y1) * container->manager().ui_aspect(); float space_x = (y2 - y1) * container->manager().ui_aspect(container);
float total = (m_valid * space_x) + ((m_valid - 1) * 0.001f); auto total = (float)(m_valid * space_x) + ((float)(m_valid - 1) * 0.001f);
x1 = ((x2 - x1) * 0.5f) - (total / 2); x1 += (x2 - x1) * 0.5f - total * 0.5f;
x2 = x1 + space_x; x2 = x1 + space_x;
for (int z = 0; z < UI_TOOLBAR_BUTTONS; ++z) for (int z = 0; z < UI_TOOLBAR_BUTTONS; ++z)