Esempio n. 1
0
 def pixclose(self, event):
     if len(self.edges[-1]) > 1:
         line = util.bresenham_int(self.edges[-1][0][0],
                                   self.edges[-1][0][1],
                                   self.edges[-1][-1][0],
                                   self.edges[-1][-1][1], self.color)
         util.draw_line(self.image, line)
         self.edges.append([])
Esempio n. 2
0
 def pixclick(self, event):
     self.edges[-1].extend([[event.x, event.y, self.color]])
     if len(self.edges[-1]) > 1:
         line = util.bresenham_int(self.edges[-1][-2][0],
                                   self.edges[-1][-2][1],
                                   self.edges[-1][-1][0],
                                   self.edges[-1][-1][1], self.color)
         util.draw_line(self.image, line)
Esempio n. 3
0
 def add_dot(self):
     x = int(self.xsb.get())
     y = int(self.ysb.get())
     self.edges[-1].extend([[x, y, self.color]])
     if len(self.edges[-1]) > 1:
         line = util.bresenham_int(self.edges[-1][-2][0],
                                   self.edges[-1][-2][1],
                                   self.edges[-1][-1][0],
                                   self.edges[-1][-1][1], self.color)
         util.draw_line(self.image, line)