patern_preview: Adding patern preview
This adds a preview of the patern placement, checking out of bound
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* File name: selection.cpp
|
||||
* File name: snapping.hpp
|
||||
* Author: lejulien
|
||||
* Date created: 01-01-1970 00:59:59
|
||||
// Date modified: 12-01-2026 21:30:10
|
||||
@@ -13,12 +13,6 @@
|
||||
#include <raylib.h>
|
||||
#include <cmath>
|
||||
|
||||
Vector2 snapToGrid(Vector2 screen, int cell_size) {
|
||||
return {static_cast<float>(round(screen.x / cell_size) * cell_size),
|
||||
static_cast<float>(round(screen.y / cell_size) * cell_size)};
|
||||
}
|
||||
Vector2 snapToGrid(Vector2 screen, int cell_size);
|
||||
|
||||
Vector2i screenToGrid(Vector2 screen, int cell_size) {
|
||||
return {static_cast<int>(round(screen.x / cell_size)),
|
||||
static_cast<int>(round(screen.y / cell_size))};
|
||||
}
|
||||
Vector2i screenToGrid(Vector2 screen, int cell_size);
|
||||
|
||||
Reference in New Issue
Block a user