예제 #1
0
 def set_arc(self, x, y, width, height, start, stop, mode):
     x1 = x - (width + 1) // 2
     y1 = y - (height + 1) // 2
     x2 = x + width // 2 + 1
     y2 = y + height // 2 + 1
     start = degrees(start)
     stop = degrees(stop)
     angle = start - stop
     mode = mode.lower()
     if mode == 'pie':
         mode += 'slice'
     action = Action(
         self.canvas,
         'create_arc',
         x1,
         y1,
         x2,
         y2,
         start=start,
         extent=angle,
         style=mode,
         fill=self.pp.namespace.fill.hex,
         outline=self.pp.namespace.stroke.hex,
     )
     self.queued_actions.append(action)
예제 #2
0
 def set_polygon(self, points):
     action = Action(
         self.canvas,
         'create_polygon',
         points,
         fill=self.pp.namespace.fill.hex,
         outline=self.pp.namespace.stroke.hex,
     )
     self.queued_actions.append(action)
예제 #3
0
 def set_line(self, x1, y1, x2, y2):
     action = Action(
         self.canvas,
         'create_line',
         x1,
         y1,
         x2,
         y2,
         fill=self.pp.namespace.stroke.hex,
     )
     self.queued_actions.append(action)
예제 #4
0
 def set_point(self, x, y):
     action = Action(
         self.canvas,
         'create_line',
         x,
         y,
         x + 1,
         y + 1,
         fill=self.pp.namespace.stroke.hex,
     )
     self.queued_actions.append(action)
예제 #5
0
 def set_rectangle(self, x1, y1, width, height):
     x2 = x1 + width + 1
     y2 = y1 + height + 1
     action = Action(self.canvas,
                     'create_rectangle',
                     x1,
                     y1,
                     x2,
                     y2,
                     fill=self.fill.hex,
                     outline=self.stroke.hex)
     self.queued_actions.append(action)
예제 #6
0
 def set_ellipse(self, x, y, width, height):
     x1 = x - (width + 1) // 2
     y1 = y - (height + 1) // 2
     x2 = x + width // 2 + 1
     y2 = y + height // 2 + 1
     action = Action(
         self.canvas,
         'create_oval',
         x1,
         y1,
         x2,
         y2,
         fill=self.pp.namespace.fill.hex,
         outline=self.pp.namespace.stroke.hex,
     )
     self.queued_actions.append(action)
예제 #7
0
 def set_line(self, x, y, width, height):
     action = Action(
         self.canvas, 'create_line',
         x, y, x + width, y + height, color=self.stroke,
     )
     self.queued_actions.append(action)
예제 #8
0
 def set_background(self, color):
     action = Action(self.canvas, 'config', bg=color)
     self.queued_actions.append(action)