def draw_single_pixel(self, pixel):
if pixel.color != self.current_color:
if self.checkDither(pixel.position):
self.store_undo_stroke(pixel.index)
pixel.color = self.current_color
#self.pixel_path.append(pixel)
old_img = self.image_view.image
path = ui.Path.rect(*pixel.rect)
with ui.ImageContext(self.width, self.height) as ctx:
if old_img:
old_img.draw()
ui.set_color(self.current_color)
pixel_path = ui.Path.rect(*pixel.rect)
pixel_path.line_width = 0.5
pixel_path.fill()
pixel_path.stroke()
self.set_image(ctx.get_image())
评论列表
文章目录