original_docstring: Uses given canvas to draw the glyph.
docstring: Uses given canvas to draw the glyph.
docstring_tokens: Uses given canvas to draw the glyph .
code: def draw(self, canvas, source=UNDEF, **overrides):
          """Uses given canvas to draw the glyph."""
          
          # check if visible
          if not self.is_visible(source, overrides):
              return
          
          # get properties
          tag = self.get_property('tag', source, overrides)
          x1 = self.get_property('x1', source, overrides)
          y1 = self.get_property('y1', source, overrides)
          x2 = self.get_property('x2', source, overrides)
          y2 = self.get_property('y2', source, overrides)
          
          # get angle
          angle = math.atan2(y2-y1, x2-x1)
          
          # set pen and brush
          canvas.set_pen_by(self, source=source, overrides=overrides)
          canvas.fill_color = None
          
          # start drawing group
          canvas.group(tag, "arrow")
          
          # draw line
          canvas.draw_line(x1, y1, x2, y2)
          
          # set brush
          canvas.set_brush_by(self, source=source, overrides=overrides)
          
          # draw heads
          self.draw_heads(canvas,
              source = source,
              start_head_x = x1,
              start_head_y = y1,
              start_head_angle = angle+math.pi,
              start_head_angle_units = ANGLE_RAD,
              end_head_x = x2,
              end_head_y = y2,
              end_head_angle = angle,
              end_head_angle_units = ANGLE_RAD,
              **overrides)
          
          # end drawing group
          canvas.ungroup()
code_tokens: def draw ( self , canvas , source = UNDEF , ** overrides ) : if not self . is_visible ( source , overrides ) : return tag = self . get_property ( 'tag' , source , overrides ) x1 = self . get_property ( 'x1' , source , overrides ) y1 = self . get_property ( 'y1' , source , overrides ) x2 = self . get_property ( 'x2' , source , overrides ) y2 = self . get_property ( 'y2' , source , overrides ) angle = math . atan2 ( y2 - y1 , x2 - x1 ) canvas . set_pen_by ( self , source = source , overrides = overrides ) canvas . fill_color = None canvas . group ( tag , "arrow" ) canvas . draw_line ( x1 , y1 , x2 , y2 ) canvas . set_brush_by ( self , source = source , overrides = overrides ) self . draw_heads ( canvas , source = source , start_head_x = x1 , start_head_y = y1 , start_head_angle = angle + math . pi , start_head_angle_units = ANGLE_RAD , end_head_x = x2 , end_head_y = y2 , end_head_angle = angle , end_head_angle_units = ANGLE_RAD , ** overrides ) canvas . ungroup ( )
short_docstring: Uses given canvas to draw the glyph.
short_docstring_tokens: Uses given canvas to draw the glyph .
comment: """Uses given canvas to draw the glyph."""$SEP$# check if visible$SEP$# get properties$SEP$# get angle$SEP$# set pen and brush$SEP$# start drawing group$SEP$# draw line$SEP$# set brush$SEP$# draw heads$SEP$# end drawing group