@@ -86,7 +86,11 @@ func handle_input(event: InputEvent, camera: Camera3D, mouse_pos: Vector2) -> in
8686 return _handle_click (camera , mouse_pos )
8787
8888 # Right click — undo last point
89- if event is InputEventMouseButton and event .button_index == MOUSE_BUTTON_RIGHT and event .pressed :
89+ if (
90+ event is InputEventMouseButton
91+ and event .button_index == MOUSE_BUTTON_RIGHT
92+ and event .pressed
93+ ):
9094 return _handle_escape ()
9195
9296 # Mouse motion
@@ -244,7 +248,7 @@ func _build_path() -> void:
244248func _build_segment_brush (
245249 a : Vector3 , b : Vector3 , width : float , height : float , group_id : String
246250) -> Dictionary :
247- var dir := ( b - a )
251+ var dir := b - a
248252 dir .y = 0.0
249253 var length := dir .length ()
250254 if length < 0.01 :
@@ -262,7 +266,12 @@ func _build_segment_brush(
262266 for vert_y in [- half_h , half_h ]:
263267 for wp in [- 1.0 , 1.0 ]: # width direction
264268 for lp in [- 1.0 , 1.0 ]: # length direction
265- var world_pt : Vector3 = center + dir * (length * 0.5 * lp ) + perp * (half_w * wp ) + Vector3 (0 , vert_y , 0 )
269+ var world_pt : Vector3 = (
270+ center
271+ + dir * (length * 0.5 * lp )
272+ + perp * (half_w * wp )
273+ + Vector3 (0 , vert_y , 0 )
274+ )
266275 corners .append (world_pt - center ) # to local space
267276
268277 # corners layout:
@@ -303,17 +312,16 @@ func _build_segment_brush(
303312
304313
305314func _build_miter_brush (
306- prev : Vector3 , curr : Vector3 , next : Vector3 ,
307- width : float , height : float , group_id : String
315+ prev : Vector3 , curr : Vector3 , next : Vector3 , width : float , height : float , group_id : String
308316) -> Dictionary :
309317 # Compute directions
310- var dir_in := ( curr - prev )
318+ var dir_in := curr - prev
311319 dir_in .y = 0.0
312320 if dir_in .length () < 0.01 :
313321 return {}
314322 dir_in = dir_in .normalized ()
315323
316- var dir_out := ( next - curr )
324+ var dir_out := next - curr
317325 dir_out .y = 0.0
318326 if dir_out .length () < 0.01 :
319327 return {}
@@ -366,10 +374,11 @@ func _build_miter_brush(
366374 var sorted_indices : Array = []
367375 for i in range (xz_pts .size ()):
368376 sorted_indices .append (i )
369- sorted_indices .sort_custom (func (a_idx : int , b_idx : int ) -> bool :
370- var aa := atan2 (xz_pts [a_idx ].z - cx .z , xz_pts [a_idx ].x - cx .x )
371- var bb := atan2 (xz_pts [b_idx ].z - cx .z , xz_pts [b_idx ].x - cx .x )
372- return aa < bb
377+ sorted_indices .sort_custom (
378+ func (a_idx : int , b_idx : int ) -> bool :
379+ var aa := atan2 (xz_pts [a_idx ].z - cx .z , xz_pts [a_idx ].x - cx .x )
380+ var bb := atan2 (xz_pts [b_idx ].z - cx .z , xz_pts [b_idx ].x - cx .x )
381+ return aa < bb
373382 )
374383
375384 var sorted_pts := PackedVector3Array ()
@@ -469,7 +478,7 @@ func _update_preview() -> void:
469478 for i in range (n - 1 ):
470479 var a : Vector3 = _waypoints [i ]
471480 var b : Vector3 = _waypoints [i + 1 ]
472- var dir := ( b - a )
481+ var dir := b - a
473482 dir .y = 0.0
474483 if dir .length () < 0.01 :
475484 continue
0 commit comments