fix text node pad and font height bounds
This commit is contained in:
@@ -123,17 +123,17 @@ void NodeText::update_layout()
|
||||
auto pad = GetPadding();
|
||||
if (auto_width)
|
||||
{
|
||||
YGNodeStyleSetWidth(y_node, m_text_mesh.bb.x);
|
||||
m_size.x = m_text_mesh.bb.x;
|
||||
YGNodeStyleSetWidth(y_node, m_text_mesh.bb.x + (pad[1] + pad[3]));
|
||||
m_size.x = m_text_mesh.bb.x + (pad[1] + pad[3]);
|
||||
}
|
||||
if (auto_height)
|
||||
{
|
||||
YGNodeStyleSetHeight(y_node, m_text_mesh.bb.y);
|
||||
m_size.y = m_text_mesh.bb.y;
|
||||
YGNodeStyleSetHeight(y_node, m_text_mesh.bb.y + (pad[0] + pad[2]));
|
||||
m_size.y = m_text_mesh.bb.y + (pad[0] + pad[2]);
|
||||
}
|
||||
|
||||
float h = m_size.y - (pad[1] + pad[3]);
|
||||
float w = m_size.x - (pad[0] + pad[2]);
|
||||
float w = m_size.x - (pad[1] + pad[3]);
|
||||
float h = m_size.y - (pad[0] + pad[2]);
|
||||
|
||||
if (m_text_align_v == TextAlign::Begin)
|
||||
m_off.y = pad[0];
|
||||
|
||||
Reference in New Issue
Block a user