@@ -33,50 +33,50 @@ def __init__(self, *args, **kwargs):
3333 # Rectangles methods
3434 def fill_rect (self , x , y , width , height ):
3535 """Draw a filled rectangle."""
36- self ._send_canvas_msg ('fillRect' , x , y , width , height )
36+ self ._send_canvas_command ('fillRect' , x , y , width , height )
3737
3838 def stroke_rect (self , x , y , width , height ):
3939 """Draw a rectangular outline."""
40- self ._send_canvas_msg ('strokeRect' , x , y , width , height )
40+ self ._send_canvas_command ('strokeRect' , x , y , width , height )
4141
4242 def clear_rect (self , x , y , width , height ):
4343 """Clear the specified rectangular area, making it fully transparent."""
44- self ._send_canvas_msg ('clearRect' , x , y , width , height )
44+ self ._send_canvas_command ('clearRect' , x , y , width , height )
4545
4646 def rect (self , x , y , width , height ):
4747 """Draw a rectangle whose top-left corner is specified by (x, y) with the specified width and height."""
48- self ._send_canvas_msg ('rect' , x , y , width , height )
48+ self ._send_canvas_command ('rect' , x , y , width , height )
4949
5050 # Paths methods
5151 def begin_path (self ):
52- self ._send_canvas_msg ('beginPath' )
52+ self ._send_canvas_command ('beginPath' )
5353
5454 def close_path (self ):
55- self ._send_canvas_msg ('closePath' )
55+ self ._send_canvas_command ('closePath' )
5656
5757 def stroke (self ):
58- self ._send_canvas_msg ('stroke' )
58+ self ._send_canvas_command ('stroke' )
5959
6060 def fill (self ):
61- self ._send_canvas_msg ('fill' )
61+ self ._send_canvas_command ('fill' )
6262
6363 def move_to (self , x , y ):
64- self ._send_canvas_msg ('moveTo' , x , y )
64+ self ._send_canvas_command ('moveTo' , x , y )
6565
6666 def line_to (self , x , y ):
67- self ._send_canvas_msg ('lineTo' , x , y )
67+ self ._send_canvas_command ('lineTo' , x , y )
6868
6969 def arc (self , x , y , radius , start_angle , end_angle , anticlockwise ):
70- self ._send_canvas_msg ('arc' , x , y , radius , start_angle , end_angle , anticlockwise )
70+ self ._send_canvas_command ('arc' , x , y , radius , start_angle , end_angle , anticlockwise )
7171
7272 def arc_to (self , x1 , y1 , x2 , y2 , radius ):
73- self ._send_canvas_msg ('arcTo' , x1 , y1 , x2 , y2 , radius )
73+ self ._send_canvas_command ('arcTo' , x1 , y1 , x2 , y2 , radius )
7474
7575 def quadratic_curve_to (self , cp1x , cp1y , x , y ):
76- self ._send_canvas_msg ('quadraticCurveTo' , cp1x , cp1y , x , y )
76+ self ._send_canvas_command ('quadraticCurveTo' , cp1x , cp1y , x , y )
7777
7878 def bezier_curve_to (self , cp1x , cp1y , cp2x , cp2y , x , y ):
79- self ._send_canvas_msg ('bezierCurveTo' , cp1x , cp1y , cp2x , cp2y , x , y )
79+ self ._send_canvas_command ('bezierCurveTo' , cp1x , cp1y , cp2x , cp2y , x , y )
8080
81- def _send_canvas_msg (self , msg_name , * args ):
82- self .send ({'msg ' : msg_name , 'args' : args })
81+ def _send_canvas_command (self , name , * args ):
82+ self .send ({'name ' : name , 'args' : args })
0 commit comments