@@ -29,7 +29,7 @@ var mouse_click_start_pos := Vector2.INF
2929
3030#  A boolean to tell whether we've set undo_elements_list_num, which holds the size of draw_elements_list
3131#  before a new stroke is added (unless the current brush mode is 'rectangle shape' or 'circle shape', in
32- #  which case we do things a litte  differently. See the undo_stroke function for more details).
32+ #  which case we do things a little  differently. See the undo_stroke function for more details).
3333var  undo_set  :=  false 
3434var  undo_element_list_num  :=  - 1 
3535
@@ -73,7 +73,7 @@ func _process(_delta: float) -> void:
7373					add_brush (mouse_pos , brush_mode )
7474
7575	else :
76- 		#  We've finished our stroke, so we can set a new undo (if a new storke  is made).
76+ 		#  We've finished our stroke, so we can set a new undo (if a new stroke  is made).
7777		undo_set  =  false 
7878
7979		#  If the mouse is inside the canvas.
@@ -97,7 +97,7 @@ func check_if_mouse_is_inside_canvas() -> bool:
9797	#  Make sure we have a mouse click starting position.
9898	if  mouse_click_start_pos  !=  null :
9999		#  Make sure the mouse click starting position is inside the canvas.
100- 		#  This is so if we start out click outside the canvas (say chosing  a color from the color picker)
100+ 		#  This is so if we start out click outside the canvas (say choosing  a color from the color picker)
101101		#  and then move our mouse back into the canvas, it won't start painting.
102102		if  Rect2 (drawing_area .position , drawing_area .size ).has_point (mouse_click_start_pos ):
103103			#  Make sure the current mouse position is inside the canvas.
@@ -141,14 +141,14 @@ func add_brush(mouse_pos: Vector2, type: BrushMode) -> void:
141141	var  new_brush  :=  {}
142142
143143	#  Populate the dictionary with values based on the global brush variables.
144- 	#  We will override these as needed if the brush is a rectange  or circle.
144+ 	#  We will override these as needed if the brush is a rectangle  or circle.
145145	new_brush .brush_type  =  type 
146146	new_brush .brush_pos  =  mouse_pos 
147147	new_brush .brush_shape  =  brush_shape 
148148	new_brush .brush_size  =  brush_size 
149149	new_brush .brush_color  =  brush_color 
150150
151- 	#  If the new bursh  is a rectangle shape, we need to calculate the top left corner of the rectangle and the
151+ 	#  If the new brush  is a rectangle shape, we need to calculate the top left corner of the rectangle and the
152152	#  bottom right corner of the rectangle.
153153	if  type  ==  BrushMode .RECTANGLE_SHAPE :
154154		var  TL_pos  :=  Vector2 ()
@@ -176,10 +176,10 @@ func add_brush(mouse_pos: Vector2, type: BrushMode) -> void:
176176
177177	#  If the brush isa circle shape, then we need to calculate the radius of the circle.
178178	if  type  ==  BrushMode .CIRCLE_SHAPE :
179- 		#  Get the center point inbetween  the mouse position and the position of the mouse when we clicked.
179+ 		#  Get the center point in between  the mouse position and the position of the mouse when we clicked.
180180		var  center_pos  :=  Vector2 ((mouse_pos .x  +  mouse_click_start_pos .x ) /  2 , (mouse_pos .y  +  mouse_click_start_pos .y ) /  2 )
181181		#  Assign the brush position to the center point, and calculate the radius of the circle using the distance from
182- 		#  the center to the top/bottom positon  of the mouse.
182+ 		#  the center to the top/bottom position  of the mouse.
183183		new_brush .brush_pos  =  center_pos 
184184		new_brush .brush_shape_circle_radius  =  center_pos .distance_to (Vector2 (center_pos .x , mouse_pos .y ))
185185
@@ -193,7 +193,7 @@ func _draw() -> void:
193193		match  brush .brush_type :
194194			BrushMode .PENCIL :
195195				#  If the brush shape is a rectangle, then we need to make a Rect2 so we can use draw_rect.
196- 				#  Draw_rect draws a rectagle  at the top left corner, using the scale for the size.
196+ 				#  Draw_rect draws a rectangle  at the top left corner, using the scale for the size.
197197				#  So we offset the position by half of the brush size so the rectangle's center is at mouse position.
198198				if  brush .brush_shape  ==  BrushShape .RECTANGLE :
199199					var  rect  :=  Rect2 (brush .brush_pos  -  Vector2 (brush .brush_size  /  2 , brush .brush_size  /  2 ), Vector2 (brush .brush_size , brush .brush_size ))
@@ -214,7 +214,7 @@ func _draw() -> void:
214214				elif  brush .brush_shape  ==  BrushShape .CIRCLE :
215215					draw_circle (brush .brush_pos , brush .brush_size  /  2 , bg_color )
216216			BrushMode .RECTANGLE_SHAPE :
217- 				#  We make a Rect2 with the postion  at the top left. To get the size we take the bottom right position
217+ 				#  We make a Rect2 with the position  at the top left. To get the size we take the bottom right position
218218				#  and subtract the top left corner's position.
219219				var  rect  :=  Rect2 (brush .brush_pos , brush .brush_shape_rect_pos_BR  -  brush .brush_pos )
220220				draw_rect (rect , brush .brush_color )
0 commit comments