diff --git a/src/Tools/UtilityTools/Move.gd b/src/Tools/UtilityTools/Move.gd index 4918e90f3..dcca36e9f 100644 --- a/src/Tools/UtilityTools/Move.gd +++ b/src/Tools/UtilityTools/Move.gd @@ -18,16 +18,18 @@ func _input(event: InputEvent) -> void: _snap_to_grid = true _offset = _offset.snapped(Global.grid_size) if Global.current_project.has_selection and selection_node.is_moving_content: - var prev_pos: Vector2 = selection_node.big_bounding_rectangle.position - selection_node.big_bounding_rectangle.position = prev_pos.snapped(Global.grid_size) + var prev_pos: Vector2i = selection_node.big_bounding_rectangle.position + selection_node.big_bounding_rectangle.position = Vector2i( + prev_pos.snapped(Global.grid_size) + ) # The first time transform_snap_grid is enabled then _snap_position() is not called # and the selection had wrong offset, so do selection offsetting here - var grid_offset := Global.grid_offset - grid_offset = Vector2( - fmod(grid_offset.x, Global.grid_size.x), fmod(grid_offset.y, Global.grid_size.y) + var grid_offset := Vector2i( + fmod(Global.grid_offset.x, Global.grid_size.x), + fmod(Global.grid_offset.y, Global.grid_size.y) ) selection_node.big_bounding_rectangle.position += grid_offset - selection_node.marching_ants_outline.offset += ( + selection_node.marching_ants_outline.offset += Vector2( selection_node.big_bounding_rectangle.position - prev_pos ) elif event.is_action_released("transform_snap_grid"):