33
44from Config import Config
55from figures import moveto
6- from recording .record_turtle import pu , pd , fd , rt , lt
6+ from recording .record_turtle import pu , pd
77
88
99class Figure (ABC ):
@@ -12,15 +12,27 @@ class Figure(ABC):
1212 width = Config .default_width
1313 height = Config .default_height
1414
15- def __init__ (self , width : int = None , height : int = None , x_coor : int = None , y_coor : int = None ):
15+ def __init__ (
16+ self ,
17+ width : int = None ,
18+ height : int = None ,
19+ x_coor : int = None ,
20+ y_coor : int = None ,
21+ ):
1622 self .x_coor = x_coor
1723 self .y_coor = y_coor
1824 if height is not None :
1925 self .height = height
2026 if width is not None :
2127 self .width = width
2228
23- def draw (self , width : int = None , height : int = None , border_width : int = None , border_height : int = None ):
29+ def draw (
30+ self ,
31+ width : int = None ,
32+ height : int = None ,
33+ border_width : int = None ,
34+ border_height : int = None ,
35+ ):
2436 moveto (self .x_coor , self .y_coor )
2537 if width is None :
2638 width = self .width
@@ -34,10 +46,21 @@ def draw(self, width: int = None, height: int = None, border_width: int = None,
3446 self ._draw (width - (border_width or 0 ), height - (border_height or 0 ))
3547 pu ()
3648
37- def undo (self , width : int = None , height : int = None , border_width : int = None , border_height : int = None ):
49+ def undo (
50+ self ,
51+ width : int = None ,
52+ height : int = None ,
53+ border_width : int = None ,
54+ border_height : int = None ,
55+ ):
3856 color ("white" )
39- self .draw (width = width , height = height , border_width = border_width , border_height = border_height )
40- color ("black" )
57+ self .draw (
58+ width = width ,
59+ height = height ,
60+ border_width = border_width ,
61+ border_height = border_height ,
62+ )
63+ color (Config .color )
4164
4265 @abstractmethod
4366 def _draw (self , width : int , height : int ):
0 commit comments