Fix of several issues related to gizmos updating and undo/redo

Common gizmos data cannot be used in on_set_state method
Also prevented calling render on empty GLVertexArrays
This commit is contained in:
Lukas Matena 2020-06-01 10:01:45 +02:00
parent 10c59b0d00
commit 2cc1dffc82
8 changed files with 70 additions and 50 deletions

View file

@ -28,8 +28,7 @@ bool GLGizmoFlatten::on_init()
void GLGizmoFlatten::on_set_state()
{
if (m_state == On && is_plane_update_necessary())
update_planes();
}
CommonGizmosDataID GLGizmoFlatten::on_get_requirements() const
@ -81,7 +80,8 @@ void GLGizmoFlatten::on_render() const
else
glsafe(::glColor4f(0.9f, 0.9f, 0.9f, 0.5f));
m_planes[i].vbo.render();
if (m_planes[i].vbo.has_VBOs())
m_planes[i].vbo.render();
}
glsafe(::glPopMatrix());
}