blackboard.AddManipulator(m_WindowDraggable);
m_ResizeBorderFrame = new ResizeBorderFrame(blackboard) { name = "resizeBorderFrame" };
m_ResizeBorderFrame.stayWithinParentBounds = true;
blackboard.shadow.Add(m_ResizeBorderFrame);
m_Section = new BlackboardSection { headerVisible = false };
Add(preview);
m_PreviewResizeBorderFrame = new ResizeBorderFrame(previewTextureView, this) { name = "resizeBorderFrame" };
m_PreviewResizeBorderFrame.stayWithinParentBounds = true;
m_PreviewResizeBorderFrame.maintainAspectRatio = true;
Add(m_PreviewResizeBorderFrame);
{
List<ResizeSideHandle> m_ResizeSideHandles;
bool m_StayWithinParentBounds;
public bool stayWithinParentBounds
get { return m_StayWithinParentBounds; }
set
m_StayWithinParentBounds = value;
foreach (ResizeSideHandle resizeHandle in m_ResizeSideHandles)
resizeHandle.stayWithinParentBounds = value;
}
bool m_MaintainApsectRatio;
public bool maintainAspectRatio
m_ResizeSideHandles = new List<ResizeSideHandle>();
// Add resize handles along the border
m_ResizeSideHandles.Add(new ResizeSideHandle(target, container, ResizeHandleAnchor.TopLeft));
m_ResizeSideHandles.Add(new ResizeSideHandle(target, container, ResizeHandleAnchor.Top));
m_ResizeSideHandles.Add(new ResizeSideHandle(target, container, ResizeHandleAnchor.TopRight));
WindowDockingLayout m_WindowDockingLayout;
set { m_StayWithinParentBounds = value; }
bool m_MaintainAspectRatio;
void InitialLayoutSetup(GeometryChangedEvent evt)
m_ResizeTarget.UnregisterCallback<GeometryChangedEvent>(InitialLayoutSetup);
Vector2 BoundedMousePosition(Vector2 mousePosition)
mousePosition = m_Container.parent.WorldToLocal(mousePosition);
if (!stayWithinParentBounds)
return mousePosition;
mousePosition.x = Mathf.Clamp(mousePosition.x, 5f, m_Container.parent.layout.width);
mousePosition.y = Mathf.Clamp(mousePosition.y, 5f, m_Container.parent.layout.height);
void HandleResizeFromTop(MouseMoveEvent mouseMoveEvent)