fix scissor clipping on draw

This commit is contained in:
2019-02-27 21:33:48 +01:00
parent b8cf9c7318
commit 0e90264d7c

View File

@@ -576,8 +576,10 @@ void App::update(float dt)
{
if (n && n->m_display)
{
auto box = n->m_clip;
auto box = n->m_clip_uncut;
Node* p = n->parent;
if (dynamic_cast<NodeBrushPresetItem*>(n))
p = p;
while (p)
{
float pt = YGNodeLayoutGetPadding(p->y_node, YGEdgeTop);
@@ -586,7 +588,7 @@ void App::update(float dt)
float pl = YGNodeLayoutGetPadding(p->y_node, YGEdgeLeft);
glm::vec2 off_p(pl, pt);
glm::vec2 off_s(pr, pb);
glm::vec4 pclip = { xy(p->m_clip) + off_p, zw(p->m_clip) - off_s - off_p };
glm::vec4 pclip = { xy(p->m_clip_uncut) + off_p, zw(p->m_clip_uncut) - off_s - off_p };
box = rect_intersection(box, pclip);
p = p->parent;
}