def draw_fill(self): graphics.enter_canvas_mode() graphics.set_line_width(self.point_size) if not self.smooth_points: graphics.call_twice(pyglet.gl.glDisable, pyglet.gl.GL_POINT_SMOOTH) draw.points(self.pixels_old, self.pixel_colors_old) draw.points(self.pixels, self.pixel_colors) if not self.smooth_points: graphics.call_twice(pyglet.gl.glEnable, pyglet.gl.GL_POINT_SMOOTH) self.pixels_old, self.pixel_colors_old = self.pixels, self.pixel_colors self.pixels, self.pixel_colors = [], [] graphics.exit_canvas_mode()
def draw_shape_ellipse(self): graphics.enable_line_stipple() graphics.set_line_width(1.0) #graphics.set_color(0,0,0,1) graphics.set_color(color=graphics.get_line_color()) old_line_size = graphics.user_line_size def temp1(): graphics.user_line_size = 1.0 def temp2(): graphics.user_line_size = old_line_size graphics.call_twice(temp1) draw.ellipse_outline( self.img_x+1, self.img_y+1, self.img_x+abs(self.w)-1, self.img_y+abs(self.h)-1 ) graphics.disable_line_stipple() graphics.call_twice(temp2)