caves.py 文件源码

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

项目:caves 作者: mikaelho 项目源码 文件源码
def touch_moved(self, data):
    if self.dragging_waypoint:
      self.w.center = data.location
      return
    if self.flood_filling:
      if Vector(data.location).distance_to(self.touch_start) < 10:
        return
      else:
        self.flood_fill(self.control.edit_menu['flood_fill'])
    (w, h) = self.img.size
    with ui.ImageContext(w,h) as ctx:
      self.img.draw()
      blend_mode = ui.BLEND_CLEAR if self.digging else ui.BLEND_NORMAL
      ui.set_blend_mode(blend_mode)
      ui.set_color('black')
      (x, y) = data.location #* self.multiplier
      (px, py) = data.prev_location #* self.multiplier
      path = ui.Path()
      path.move_to(px, py)
      path.line_to(x, y)
      path.line_width = 30 #* self.multiplier #if self.digging else 1
      path.line_cap_style = ui.LINE_CAP_ROUND
      path.stroke()
      self.img = ctx.get_image()
    #self.set_needs_display()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号