1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

offset corrections (#712)

* offset corrections

* formatting
This commit is contained in:
Variable 2022-07-02 18:26:53 +05:00 committed by GitHub
parent b95d884dcc
commit 9805af36b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -141,8 +141,12 @@ func draw_move(position: Vector2) -> void:
selection_node.big_bounding_rectangle.position selection_node.big_bounding_rectangle.position
- prev_pos - prev_pos
) )
position = position.snapped(Vector2(Global.grid_width, Global.grid_height)) position = position.snapped(grid_size)
position += Vector2(Global.grid_offset_x, Global.grid_offset_y) var grid_offset = Vector2(Global.grid_offset_x, Global.grid_offset_y)
grid_offset = Vector2(
fmod(grid_offset.x, grid_size.x), fmod(grid_offset.y, grid_size.y)
)
position += grid_offset
if _move_content: if _move_content:
selection_node.move_content(position - _offset) selection_node.move_content(position - _offset)