c64_painter.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:Pythonista-C64-Painter 作者: superrune 项目源码 文件源码
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())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号