Beispiel #1
0
 def _draw(self):
     # Update ticks prior to drawing if required
     if self._ticks_need_updating:
         self._update_xticks()
         self._update_yticks()
         self._ticks_need_updating = False
     # Prepare for plotting
     gl.glMatrixMode(gl.GL_MODELVIEW)
     gl.glPushMatrix()
     gl.glLoadMatrixd(self._gl_mview_xylims)
     # Clip everything in the pane
     gl.glScissor(*self._gl_scissor_xylims)
     gl.glEnable(gl.GL_SCISSOR_TEST)
     # Clear region defined by scissor-clipping
     gl.glClearColor(*self._bgcolour)
     gl.glClear(gl.GL_COLOR_BUFFER_BIT)
     for line in self.lines:
         line.draw()
     # Unclip to draw borders (all settings should be restored)
     gl.glDisable(gl.GL_SCISSOR_TEST)
     # Draw border in figure space (line never needs updating)
     gl.glLoadMatrixd(self._figure._gl_mview_xylims)
     self._edge_line.draw()
     # Draw tick text in pixel space
     gl.glPopMatrix()
     for t in self._gl_xticks.values() + self._gl_yticks.values():
         t['glt'].draw()
 def _draw(self):
     gl.glMatrixMode(gl.GL_MODELVIEW)
     gl.glPushMatrix()
     gl.glMultMatrixd(self._gl_mview_offset_scale)
     super(GLLineOffsetScale, self)._draw()
     gl.glPopMatrix()