def keep_drawing(self, x, y, dx, dy): self.x2, self.y2 = x, y graphics.set_color(1,1,1,1) draw.image(self.canvas_pre,graphics.canvas_x,graphics.canvas_y) if graphics.fill_shapes: draw.rect(self.x1, self.y1, self.x2, self.y2, self.fill_colors) if graphics.outline_shapes: graphics.set_line_width(graphics.user_line_size) graphics.set_color(color=self.line_color) draw.rect_outline(self.x1, self.y1, self.x2, self.y2)
def draw_selection_image(self): if self.selection == None: return self.img_x, self.img_y = min(self.x1, self.x2), min(self.y1, self.y2) graphics.set_color(1,1,1,1) self.draw_selection_mask(self.x1,self.y1,self.x2,self.y2) graphics.init_stencil_mode() graphics.set_color(1,1,1,1) draw.rect(self.x1,self.y1,self.x2,self.y2) graphics.set_color(0,0,0,1) self.draw_selection_mask(self.x1,self.y1,self.x2,self.y2) graphics.stop_drawing_stencil() graphics.set_color(1,1,1,1) draw.image(self.selection, self.img_x, self.img_y) graphics.reset_stencil_mode()