only normalize component bounds in layout_element::layout_element() when components exist (nw)

avoids division by zero for sets using src/emu/layout/vertical.lay
This commit is contained in:
Oliver Stöneberg 2014-10-23 15:32:31 +02:00
parent 124803b476
commit 38b44ae386

View File

@ -452,6 +452,8 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
m_maxstate = 65536;
}
if (m_complist.first() != NULL)
{
// determine the scale/offset for normalization
float xoffs = bounds.x0;
float yoffs = bounds.y0;
@ -466,6 +468,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
curcomp->m_bounds.y0 = (curcomp->m_bounds.y0 - yoffs) * yscale;
curcomp->m_bounds.y1 = (curcomp->m_bounds.y1 - yoffs) * yscale;
}
}
// allocate an array of element textures for the states
m_elemtex.resize(m_maxstate + 1);