private Vector2 SnapToGrid(Vector2 mouse)
	{
		if (mouse.X % gridW[mode] != 0)
		{
			if (mouse.X < 0)
				mouse.X -= gridW[mode];
			mouse.X = ((int) (mouse.X / gridW[mode])) * gridW[mode];
		}
		if (mouse.Y % gridH[mode] != 0)
		{
			if (mouse.Y < 0)
				mouse.Y -= gridH[mode];
			mouse.Y = ((int) (mouse.Y / gridH[mode])) * gridH[mode];
		}
		return mouse;
	}