-
- if len(corners) < 4:
- corners.append(pygame.mouse.get_pos())
- draw.point(corners[:-1], fill=color)
- if len(corners) == 4:
- l_vert, l_hor = lines(corners)
- for l in l_vert:
- draw.line(l, fill=color, width=line_width)
- for l in l_hor:
- draw.line(l, fill=color, width=line_width)
- # TODO sort by distance
- l_vert.sort()
- l_hor.sort()
- for i in [3, 9, 15]:
- for j in [3, 9, 15]:
- hoshi(intersection(line(l_vert[i][0], l_vert[i][1]),
- line(l_hor[j][0], l_hor[j][1])))
- lines_r = [[l2ad(l, im.size) for l in l_vert],
- [l2ad(l, im.size) for l in l_hor]]
+ l_vert, l_hor = lines(corners)
+ for l in l_vert:
+ draw.line(l, fill=color, width=line_width)
+ for l in l_hor:
+ draw.line(l, fill=color, width=line_width)
+ # TODO sort by distance
+ l_vert.sort()
+ l_hor.sort()
+ for i in [3, 9, 15]:
+ for j in [3, 9, 15]:
+ hoshi(intersection(line(l_vert[i][0], l_vert[i][1]),
+ line(l_hor[j][0], l_hor[j][1])))
+ lines_r = [[l2ad(l, im.size) for l in l_vert],
+ [l2ad(l, im.size) for l in l_hor]]