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([])
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)
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)