fix combobox issue, pad scissor by 1px

This commit is contained in:
2019-08-17 10:20:05 +02:00
parent a8e9e92d96
commit c1bd377ee8
7 changed files with 53 additions and 42 deletions

View File

@@ -495,7 +495,7 @@ bool App::update_ui_observer(Node *n)
n->handle_on_screen(false, true);
n->m_on_screen = true;
}
glm::ivec4 c = glm::vec4(box.x, (height / zoom - box.y - box.w), box.z, box.w) * zoom;
glm::ivec4 c = glm::vec4(box.x - 1, (height / zoom - box.y - box.w - 1), box.z + 2, box.w + 2) * zoom;
glScissor(floorf(c.x + off_x), floorf(c.y + off_y), ceilf(c.z), ceilf(c.w));
n->draw();
return true;
@@ -532,7 +532,7 @@ void App::draw(float dt)
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#endif
glViewport(off_x, off_y, (GLsizei)width, (GLsizei)height);
//glEnable(GL_SCISSOR_TEST);
glEnable(GL_SCISSOR_TEST);
for (int i = 0; i < layout[main_id]->m_children.size(); i++)
layout[main_id]->m_children[i]->watch(observer);
//msgbox->watch(observer);