/* * File name: selection.cpp * Author: lejulien * Date created: 01-01-1970 00:59:59 // Date modified: 12-01-2026 21:30:10 * ------ */ #pragma once #include #include #include Vector2 snapToGrid(Vector2 screen, int cell_size) { return {static_cast(round(screen.x / cell_size) * cell_size), static_cast(round(screen.y / cell_size) * cell_size)}; } Vector2i screenToGrid(Vector2 screen, int cell_size) { return {static_cast(round(screen.x / cell_size)), static_cast(round(screen.y / cell_size))}; }