fix scroll node, improve animation panel

This commit is contained in:
2019-10-18 22:53:17 +02:00
parent 266573e9b4
commit 467e83b69e
8 changed files with 176 additions and 67 deletions

View File

@@ -566,7 +566,12 @@ glm::vec4 Node::get_children_rect() const
for (auto& c : m_children)
{
if (c->m_display)
{
ret = rect_union(ret, c->m_clip_uncut);
auto r = c->get_children_rect();
if (r.w > 0 && r.z > 0)
ret = rect_union(ret, r);
}
}
return ret;
}
@@ -1088,9 +1093,9 @@ void Node::update_internal(const glm::vec2& origin, const glm::mat4& proj, float
float pl = YGNodeLayoutGetPadding(m_parent->y_node, YGEdgeLeft);
glm::vec2 off_p(pl, pt);
glm::vec2 off_s(pr, pb);
glm::vec4 pclip = { xy(m_parent->m_clip) + off_p, zw(m_parent->m_clip) - (off_s + off_p)};
glm::vec4 pclip = { xy(m_parent->m_clip) + off_p, zw(m_parent->m_clip) - (off_s + off_p) };
m_clip_uncut = glm::vec4(m_pos - glm::vec2(1), m_size + glm::vec2(2));
m_clip = rect_intersection(m_clip_uncut, m_parent->m_clip);
m_clip = rect_intersection(m_clip_uncut, m_parent->m_clip) + glm::vec4(0, 0, -parent_offset);
}
else
{