Apply math07's patch for taking padding into account in height="fit", fixes #1762
This commit is contained in:
parent
5f47fee897
commit
0aacea1c0b
@ -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")
|
if (self->m_properties[PROP_WIDTH] == "fit")
|
||||||
{
|
{
|
||||||
self->m_absolute_w = (is_horizontal_row ? total_width : child_max_width);
|
self->m_absolute_w = (is_horizontal_row ? total_width : child_max_width);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user