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

@@ -63,6 +63,14 @@ void NodeCanvas::clear_context()
void NodeCanvas::draw()
{
// sanity checks
float zoom = root()->m_zoom;
if (zoom == 0.f)
zoom = 1.f;
auto box = m_clip * zoom;
if (box.z == 0 || box.w == 0)
return;
GLint vp[4];
GLfloat cc[4];
glGetIntegerv(GL_VIEWPORT, vp);
@@ -73,8 +81,6 @@ void NodeCanvas::draw()
glDisable(GL_SCISSOR_TEST);
float zoom = root()->m_zoom;
auto box = m_clip * zoom;
glm::ivec4 c = (glm::ivec4)glm::vec4(box.x, (int)(vp[3] - box.y - box.w), box.z, box.w);
//m_canvas->m_cam_rot = m_pan * 0.003f;