Popup presets panel, fix padding scissor, stacked mouse capture

This commit is contained in:
2019-01-26 00:55:57 +01:00
parent 79e4777f77
commit 14b26c8902
11 changed files with 184 additions and 66 deletions

View File

@@ -484,6 +484,20 @@ void App::update(float dt)
if (n && n->m_display)
{
auto box = n->m_clip;
Node* p = n->parent;
while (p)
{
float pt = YGNodeLayoutGetPadding(p->y_node, YGEdgeTop);
float pr = YGNodeLayoutGetPadding(p->y_node, YGEdgeRight);
float pb = YGNodeLayoutGetPadding(p->y_node, YGEdgeBottom);
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 };
box = rect_intersection(box, pclip);
p = p->parent;
}
//auto box = n->m_clip;
//glm::ivec4 c = glm::vec4((int)box.x - 1, (int)(height / zoom - box.y - box.w) - 1, (int)box.z + 2, (int)box.w + 2) * zoom;
glm::ivec4 c = glm::vec4((int)box.x, (int)(height / zoom - box.y - box.w), (int)box.z, (int)box.w) * zoom;
glScissor(c.x, c.y, c.z, c.w);