Apply math07's patch for taking padding into account in height="fit", fixes #1762

This commit is contained in:
Marianne Gagnon 2014-12-11 19:33:44 -05:00
parent 5f47fee897
commit 0aacea1c0b

View File

@ -239,6 +239,18 @@ void LayoutManager::readCoords(Widget* self)
}
}
//Add padding to <box> elements
if (self->getType() == WTYPE_DIV && self->m_show_bounding_box)
{
int padding = 15;
if (self->m_properties[PROP_DIV_PADDING].length() > 0)
padding = atoi(self->m_properties[PROP_DIV_PADDING].c_str());
child_max_height += padding * 2;
total_height += padding * 2;
total_width += padding * 2;
child_max_width = padding * 2;
}
if (self->m_properties[PROP_WIDTH] == "fit")
{
self->m_absolute_w = (is_horizontal_row ? total_width : child_max_width);