Repository navigation
Expand file tree
/
Copy pathdraw_line.py
More file actions
26 lines (23 loc) · 1.58 KB
/
Copy pathdraw_line.py
File metadata and controls
26 lines (23 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
def draw_lines(k, screen_width, screen_height, canv):
u = int(k)
for i in range(1, u // 2 + 1):
canv.create_line(screen_width / 2 + k * i, screen_height / 2 - 5, screen_width / 2 + k * i,
screen_height / 2 + 5, width=2, tags="programm")
for i in range(1, u // 2 + 1):
canv.create_line(screen_width / 2 - k * i, screen_height / 2 - 5, screen_width / 2 - k * i,
screen_height / 2 + 5, width=2, tags="programm")
for i in range(1, u // 2 + 1):
canv.create_line(screen_width / 2 + k * i, 0, screen_width / 2 + k * i, screen_height, width=0.1, fill="gray", tags="programm")
for i in range(1, u // 2 + 1):
canv.create_line(screen_width / 2 - k * i, 0, screen_width / 2 - k * i, screen_height, width=0.1, fill="gray", tags="programm")
j = screen_height / k
for i in range(1, int(j) // 2):
canv.create_line(screen_width / 2 - 5, screen_height / 2 + k * i, screen_width / 2 + 5,
screen_height / 2 + k * i, width=3, tags="programm")
for i in range(1, int(j) // 2):
canv.create_line(screen_width / 2 - 5, screen_height / 2 - k * i, screen_width / 2 + 5,
screen_height / 2 - k * i, width=3, tags="programm")
for i in range(1, int(j) // 2):
canv.create_line(0, screen_height / 2 + k * i, screen_width, screen_height / 2 + k * i, width=0.1, fill="gray", tags="programm")
for i in range(1, int(j) // 2):
canv.create_line(0, screen_height / 2 - k * i, screen_width, screen_height / 2 - k * i, width=0.1, fill="gray", tags="programm")