more lint and formatting
Some checks failed
Some checks failed
This commit is contained in:
@@ -11,7 +11,9 @@ extends RefCounted
|
||||
## var grid_pos = Match3InputHandler.get_grid_position_from_world(node, world_pos, offset, size)
|
||||
|
||||
|
||||
static func find_tile_at_position(grid: Array, grid_size: Vector2i, world_pos: Vector2) -> Node2D:
|
||||
static func find_tile_at_position(
|
||||
grid: Array, grid_size: Vector2i, world_pos: Vector2
|
||||
) -> Node2D:
|
||||
## Find the tile that contains the world position.
|
||||
##
|
||||
## Iterates through all tiles and checks if the world position falls within
|
||||
@@ -31,7 +33,9 @@ static func find_tile_at_position(grid: Array, grid_size: Vector2i, world_pos: V
|
||||
if tile and tile.has_node("Sprite2D"):
|
||||
var sprite = tile.get_node("Sprite2D")
|
||||
if sprite and sprite.texture:
|
||||
var sprite_bounds = get_sprite_world_bounds(tile, sprite)
|
||||
var sprite_bounds = get_sprite_world_bounds(
|
||||
tile, sprite
|
||||
)
|
||||
if is_point_inside_rect(world_pos, sprite_bounds):
|
||||
return tile
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user