Skip to content

Commit

Permalink
clear should redraw before drawing. This allows the ui elements to tr…
Browse files Browse the repository at this point in the history
…igger another redraw.
  • Loading branch information
mkassner committed Jul 23, 2018
1 parent a23be5c commit ec7283d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pyglui/ui.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ cdef class UI:
window_size = self.window.size

if should_redraw:

should_redraw = False
#print "UI is redrawing the screen"
push_view(self.window.size)
render_to_ui_texture(self.ui_layer)
Expand All @@ -171,6 +171,7 @@ cdef class UI:
draw_ui_texture(self.ui_layer)

if should_redraw or should_redraw_overlay:
should_redraw_overlay = False
push_view(self.window.size)
render_to_ui_texture(self.overlay_layer)
glfont.clear_state()
Expand All @@ -188,8 +189,6 @@ cdef class UI:

draw_ui_texture(self.overlay_layer)

should_redraw = False
should_redraw_overlay = False

def update(self):
unused_Input = self.handle_input()
Expand Down

0 comments on commit ec7283d

Please sign in to comment.