diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-19 17:19:32 -0400 |
| commit | c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78 (patch) | |
| tree | ee4d51c7c1d633e11f46453ef1edd3c77c4ef9f7 /Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs | |
| download | Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.gz Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.tar.bz2 Project-Sandbox-c55fba8ab2a1c9d3df65eda4a5a1e957f4aa1f78.zip | |
Inital commit
Diffstat (limited to 'Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs')
| -rw-r--r-- | Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs new file mode 100644 index 0000000..6bd2238 --- /dev/null +++ b/Library/PackageCache/com.unity.timeline@1.2.13/Editor/treeview/TimelineClipHandle.cs @@ -0,0 +1,53 @@ +using UnityEngine; + +namespace UnityEditor.Timeline +{ + class TimelineClipHandle : ILayerable + { + Rect m_Rect; + readonly TimelineClipGUI m_ClipGUI; + readonly TrimEdge m_TrimDirection; + readonly LayerZOrder m_ZOrder; + + public Rect boundingRect + { + get { return m_ClipGUI.parent.ToWindowSpace(m_Rect); } + } + + public TrimEdge trimDirection + { + get { return m_TrimDirection; } + } + + public TimelineClipGUI clipGUI + { + get { return m_ClipGUI; } + } + + public LayerZOrder zOrder + { + get { return m_ZOrder; } + } + + public TimelineClipHandle(TimelineClipGUI theClipGUI, TrimEdge trimDirection) + { + m_TrimDirection = trimDirection; + m_ClipGUI = theClipGUI; + m_ZOrder = theClipGUI.zOrder.ChangeLayer(Layer.ClipHandles); + } + + public void Draw(Rect clientRect, float width, WindowState state) + { + var handleRect = clientRect; + handleRect.width = width; + + if (m_TrimDirection == TrimEdge.End) + handleRect.x = clientRect.xMax - width; + + m_Rect = handleRect; + if (!TimelineWindow.instance.state.editSequence.isReadOnly) + EditorGUIUtility.AddCursorRect(handleRect, MouseCursor.SplitResizeLeftRight); + state.spacePartitioner.AddBounds(this, boundingRect); + } + } +} |
