def create_triangle_handler(self, x, y): if FigureManager.get_figure() == "triangle": r = TRIANGLE_START_SIZE x1, y1 = x, y x2, y2 = x - r, y x3, y3 = x, y - r triangle = Triangle(x1, y1, x2, y2, x3, y3) FigureManager.set_menu_figure(triangle) self.painter.draw_triangle(triangle)
def create_point_handler(self, x, y): if FigureManager.get_figure() == "point": point = Point(x, y) FigureManager.set_menu_figure(point) self.painter.draw_point(point, POINT_SIZE)
def create_circle_handler(self, x, y): if FigureManager.get_figure() == "circle": circle = Circle(x, y, CIRCLE_START_RADIUS) FigureManager.set_menu_figure(circle) self.painter.draw_circle(circle)