浏览代码

Make floating windows serialize layout realtive to correct content area

/main
Jens Holm 7 年前
当前提交
8e243e0b
共有 2 个文件被更改,包括 6 次插入7 次删除
  1. 6
      com.unity.shadergraph/Editor/Drawing/Manipulators/WindowDraggable.cs
  2. 7
      com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs

6
com.unity.shadergraph/Editor/Drawing/Manipulators/WindowDraggable.cs


// Recalculate which corner to dock to
m_WindowDockingLayout.CalculateDockingCornerAndOffset(target.layout, target.parent.layout);
// Make sure that the window offset is non-negative (remains in screen).
Vector2 positionOffset = new Vector2(m_WindowDockingLayout.horizontalOffset, m_WindowDockingLayout.verticalOffset);
positionOffset.x = Mathf.Max(positionOffset.x, 0f);
positionOffset.y = Mathf.Max(positionOffset.y, 0f);
m_WindowDockingLayout.ClampToParentWindow();
// Use the docking results to figure which of left/right and top/bottom needs to be set.
m_WindowDockingLayout.ApplyPosition(target);

7
com.unity.shadergraph/Editor/Drawing/Views/GraphEditorView.cs


if (m_FloatingWindowsLayout == null)
m_FloatingWindowsLayout = new FloatingWindowsLayout();
m_FloatingWindowsLayout.previewLayout.CalculateDockingCornerAndOffset(m_MasterPreviewView.layout, layout);
m_FloatingWindowsLayout.blackboardLayout.CalculateDockingCornerAndOffset(m_BlackboardProvider.blackboard.layout, layout);
m_FloatingWindowsLayout.previewLayout.CalculateDockingCornerAndOffset(m_MasterPreviewView.layout, m_GraphView.layout);
m_FloatingWindowsLayout.previewLayout.ClampToParentWindow();
m_FloatingWindowsLayout.blackboardLayout.CalculateDockingCornerAndOffset(m_BlackboardProvider.blackboard.layout, m_GraphView.layout);
m_FloatingWindowsLayout.blackboardLayout.ClampToParentWindow();
if (m_MasterPreviewView.expanded)
{

正在加载...
取消
保存