78 return std::floor((x /
gs) + 0.5f) *
gs;
87 return std::floor((y /
gs) + 0.5f) *
gs;
ComponentTypeID GetComponentTypeID_Static()
Grid-snapping helper for the VS graph canvas (Phase 7).
Singleton grid-snapping helper.
void Toggle()
Toggles snapping on/off.
static GridSnapping & Get()
Returns the single shared instance.
float SnapX(float x) const
Snaps a single x coordinate to the nearest grid line.
float SnapY(float y) const
Snaps a single y coordinate to the nearest grid line.
void SetEnabled(bool enabled)
void SetGridSize(int size)
Sets the grid cell size.
void Snap(float &x, float &y) const
Snaps both x and y coordinates in place.
int GetGridSize() const
Returns the current grid cell size in pixels (default: 16).
< Provides AssetID and INVALID_ASSET_ID