def on_pos(self, *args): del args with self.canvas: Color(*self.config['color']) KivyPoint(points=self.config['points'], pointsize=self.config['pointsize'])
def __init__(self, points=None, pointsize=1., color=None, alpha=1., **kwargs): super().__init__(**kwargs) self._color = KivyColor(rgb=color or OFFWHITE, a=alpha) self._shape = KivyPoint( points=points, pointsize=pointsize, ) self.add(self._color) self.add(self._shape)
def _draw_widget(self, *args) -> None: """Establish the drawing instructions for the widget.""" del args if self.canvas is None: return # TODO: allow user to set rotation/scale origin center = center_of_points_list(self.points) self.canvas.clear() with self.canvas: Color(*self.color) Scale(self.scale, origin=center) Rotate(angle=self.rotation, origin=center) KivyPoint(points=self.points, pointsize=self.pointsize)