浏览代码

Make resizeing from left and top not move the inspector window when reaching minimum size

/main
Jens Holm 7 年前
当前提交
429a5f71
共有 1 个文件被更改,包括 19 次插入4 次删除
  1. 23
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs

23
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Inspector/GraphInspectorView.cs


normalizedResizeDelta.y = 0f;
}
Vector2 newSize = new Vector2();
Vector2 newPosition = new Vector2(style.positionLeft, style.positionTop);
style.positionLeft += normalizedResizeDelta.x;
style.positionTop += normalizedResizeDelta.y;
newPosition.x = style.positionLeft + normalizedResizeDelta.x;
newPosition.y = style.positionTop + normalizedResizeDelta.y;
style.width = Mathf.Max(style.width + normalizedResizeDelta.x, 60f);
style.height = Mathf.Max(style.height + normalizedResizeDelta.y, 60f);
newSize.x = Mathf.Max(style.width + normalizedResizeDelta.x, 60f);
newSize.y = Mathf.Max(style.height + normalizedResizeDelta.y, 60f);
if (newSize.x > 60f)
{
style.positionLeft = newPosition.x;
style.width = Mathf.Max(style.width + normalizedResizeDelta.x, 60f);
}
if (newSize.y > 60f)
{
style.positionTop = newPosition.y;
style.height = Mathf.Max(style.height + normalizedResizeDelta.y, 60f);
}
}
MasterNode masterNode

正在加载...
取消
保存