godot/component/ellipse.py
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"):
        """ Draws the component """

        x_origin = self.x_origin
        y_origin = self.y_origin

        gc.save_state()
        try:
#            self._draw_bounds(gc)
            gc.begin_path()
            gc.translate_ctm(x_origin, y_origin)
            gc.scale_ctm(self.e_width, self.e_height)
            gc.arc(0.0, 0.0, 1.0, 0, 2.0*pi)
            gc.close_path()

            # Draw stroke at same scale as graphics context
#            ctm = gc.get_ctm()
#            if hasattr(ctm, "__len__") and len(ctm) == 6:
#                scale = sqrt( (ctm[0]+ctm[1]) * (ctm[0]+ctm[1]) / 2.0 + \
#                              (ctm[2]+ctm[3]) * (ctm[2]+ctm[3]) / 2.0 )
#            elif hasattr(gc, "get_ctm_scale"):
#                scale = gc.get_ctm_scale()
#            else:
#                raise RuntimeError("Unable to get scale from GC.")

            gc.set_line_width(self.pen.line_width)
            gc.set_stroke_color(self.pen.color_)

            if self.filled:
                gc.set_fill_color(self.pen.fill_color_)
                gc.draw_path(FILL_STROKE)
            else:
                gc.stroke_path()
        finally:
            gc.restore_state()
def _draw_mainlayer(self, gc, view_bounds=None, mode="default"):
        """ Draws the component """

        x_origin = self.x_origin
        y_origin = self.y_origin

        gc.save_state()
        try:
#            self._draw_bounds(gc)
            gc.begin_path()
            gc.translate_ctm(x_origin, y_origin)
            gc.scale_ctm(self.e_width, self.e_height)
            gc.arc(0.0, 0.0, 1.0, 0, 2.0*pi)
            gc.close_path()

            # Draw stroke at same scale as graphics context
#            ctm = gc.get_ctm()
#            if hasattr(ctm, "__len__") and len(ctm) == 6:
#                scale = sqrt( (ctm[0]+ctm[1]) * (ctm[0]+ctm[1]) / 2.0 + \
#                              (ctm[2]+ctm[3]) * (ctm[2]+ctm[3]) / 2.0 )
#            elif hasattr(gc, "get_ctm_scale"):
#                scale = gc.get_ctm_scale()
#            else:
#                raise RuntimeError("Unable to get scale from GC.")

            gc.set_line_width(self.pen.line_width)
            gc.set_stroke_color(self.pen.color_)

            if self.filled:
                gc.set_fill_color(self.pen.fill_color_)
                gc.draw_path(FILL_STROKE)
            else:
                gc.stroke_path()
        finally:
            gc.restore_state()
def _draw_mainlayer ( self , gc , view_bounds = None , mode = "default" ) : x_origin = self . x_origin y_origin = self . y_origin gc . save_state ( ) try : #            self._draw_bounds(gc) gc . begin_path ( ) gc . translate_ctm ( x_origin , y_origin ) gc . scale_ctm ( self . e_width , self . e_height ) gc . arc ( 0.0 , 0.0 , 1.0 , 0 , 2.0 * pi ) gc . close_path ( ) # Draw stroke at same scale as graphics context #            ctm = gc.get_ctm() #            if hasattr(ctm, "__len__") and len(ctm) == 6: #                scale = sqrt( (ctm[0]+ctm[1]) * (ctm[0]+ctm[1]) / 2.0 + \ #                              (ctm[2]+ctm[3]) * (ctm[2]+ctm[3]) / 2.0 ) #            elif hasattr(gc, "get_ctm_scale"): #                scale = gc.get_ctm_scale() #            else: #                raise RuntimeError("Unable to get scale from GC.") gc . set_line_width ( self . pen . line_width ) gc . set_stroke_color ( self . pen . color_ ) if self . filled : gc . set_fill_color ( self . pen . fill_color_ ) gc . draw_path ( FILL_STROKE ) else : gc . stroke_path ( ) finally : gc . restore_state ( )
Draws the component
Draws the component