浏览代码

Add flag in resize handle to maintain aspect ratio

/main
Jens Holm 7 年前
当前提交
af26c91a
共有 3 个文件被更改,包括 24 次插入1 次删除
  1. 16
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/ResizeBorderFrame.cs
  2. 8
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/ResizeSideHandle.cs
  3. 1
      MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs

16
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/ResizeBorderFrame.cs


set
{
m_StayWithinParentBounds = value;
}
}
}
bool m_MaintainApsectRatio;
public bool maintainAspectRatio
{
get { return m_MaintainApsectRatio; }
set
{
m_MaintainApsectRatio = value;
foreach (ResizeSideHandle resizeHandle in m_ResizeSideHandles)
{
resizeHandle.maintainAspectRatio = value;
}
}
}

8
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Manipulators/ResizeSideHandle.cs


set { m_StayWithinParentBounds = value; }
}
bool m_MaintainAspectRatio;
public bool maintainAspectRatio
{
get { return m_MaintainAspectRatio; }
set { m_MaintainAspectRatio = value; }
}
public Action OnResizeFinished;
public ResizeSideHandle(VisualElement resizeTarget, ResizeHandleAnchor anchor)

1
MaterialGraphProject/Assets/UnityShaderEditor/Editor/Drawing/Views/GraphEditorView.cs


ResizeBorderFrame masterPreviewResizeBorderFrame = new ResizeBorderFrame(m_MasterPreviewView) { name = "resizeBorderFrame" };
masterPreviewResizeBorderFrame.stayWithinParentBounds = true;
masterPreviewResizeBorderFrame.maintainAspectRatio = true;
masterPreviewResizeBorderFrame.OnResizeFinished += UpdateSerializedWindowLayout;
m_MasterPreviewView.Add(masterPreviewResizeBorderFrame);

正在加载...
取消
保存