private ScaleThatFitsTargetInView ( Vector2 targetInPixels, Vector2 viewInPoints ) : float | ||
targetInPixels | Vector2 | |
viewInPoints | Vector2 | |
return | float |
private float ScaleThatFitsTargetInView(Vector2 targetInPixels, Vector2 viewInPoints)
{
Vector2 vector = EditorGUIUtility.PixelsToPoints(targetInPixels);
Vector2 vector2 = new Vector2(viewInPoints.x / vector.x, viewInPoints.y / vector.y);
return Mathf.Min(vector2.x, vector2.y);
}