improve layout

This commit is contained in:
2019-03-05 14:04:57 +01:00
parent 9e26c67de6
commit 1f794a6811
7 changed files with 188 additions and 139 deletions

View File

@@ -59,7 +59,7 @@ void NodeScroll::on_tick(float dt)
auto rect = get_children_rect();
// fix scrollbar
float sz = m_size.y - (pad[0] + pad[2]);
float new_pad = rect.w == 0 || rect.w <= sz ? 5 : 35;
float new_pad = rect.w == 0 || rect.w <= sz + 2 ? 5 : 35;
if (pad[1] != new_pad)
{
YGNodeStyleSetPadding(y_node, YGEdgeRight, new_pad);