Skip to content

Commit

Permalink
Fix only last call to SVGDoc.draw() working
Browse files Browse the repository at this point in the history
Clearing the buffers on each call means that only the last call has
an effect, which prevents drawing multiple SVGs (or even the same one
multiple times) in one draw cycle.

Clearing should be (and in the case of the examples, is) done by the
calling application (eg., Pyglet's window.clear() during the on_draw
event).

(Fixes issue #3)
  • Loading branch information
Michael Schuller committed May 27, 2016
1 parent 38946ed commit 8f97224
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions glsvg/svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,6 @@ def draw(self, x, y, z=0, angle=0, scale=1):
of two floats (xscale, yscale).
"""
#CanvasManager.inst().update()
#bg = CanvasManager.inst().get('BackgroundImage')

with CurrentTransform():
gl.glTranslatef(x, y, z)
Expand All @@ -324,10 +322,7 @@ def draw(self, x, y, z=0, angle=0, scale=1):
if self._a_x or self._a_y:
gl.glTranslatef(-self._a_x, -self._a_y, 0)

#with bg:
gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
self.disp_list()
#bg.blit()

def prerender_defs(self):
gl.glEnable(gl.GL_BLEND)
Expand Down

0 comments on commit 8f97224

Please sign in to comment.