Add Ctrl to snap points to grid in Multi Blend editor

This commit is contained in:
Wojtek Figat
2024-04-18 17:04:23 +02:00
parent f8f1c02338
commit 83b9e6e32a
2 changed files with 13 additions and 3 deletions

View File

@@ -1281,8 +1281,8 @@ namespace FlaxEngine
/// <returns>The position snapped to the grid.</returns>
public static Float2 SnapToGrid(Float2 pos, Float2 gridSize)
{
pos.X = Mathf.Ceil((pos.X - (gridSize.X * 0.5f)) / gridSize.Y) * gridSize.X;
pos.Y = Mathf.Ceil((pos.Y - (gridSize.Y * 0.5f)) / gridSize.X) * gridSize.Y;
pos.X = Mathf.Ceil((pos.X - (gridSize.X * 0.5f)) / gridSize.X) * gridSize.X;
pos.Y = Mathf.Ceil((pos.Y - (gridSize.Y * 0.5f)) / gridSize.Y) * gridSize.Y;
return pos;
}