Beispiel #1
0
        protected override void OnMouseDrag(Event evt, TimelineWindow.TimelineState state, TimelineClipHandle handle)
        {
            ManipulateEdges edges = ManipulateEdges.Both;
            float           delta = evt.get_delta().x / state.timeAreaScale.x;

            TimelineUndo.PushUndo(handle.clip.clip.parentTrack, "Trim Clip");
            TimelineClipHandle.DragDirection direction = handle.direction;
            if (direction != TimelineClipHandle.DragDirection.Right)
            {
                if (direction == TimelineClipHandle.DragDirection.Left)
                {
                    double num = this.m_FrameSnap.ApplyOffset(handle.clip.clip.start, delta, state);
                    if (num > 0.0)
                    {
                        double num2 = num - handle.clip.clip.start;
                        handle.clip.clip.start = num;
                        if (handle.clip.clip.duration - num2 > TimelineClip.kMinDuration)
                        {
                            handle.clip.clip.duration -= num2;
                        }
                    }
                    edges = ManipulateEdges.Left;
                }
            }
            else
            {
                double val = this.m_FrameSnap.ApplyOffset(handle.clip.clip.duration, delta, state);
                handle.clip.clip.duration = Math.Max(val, TimelineClip.kMinDuration);
                edges = ManipulateEdges.Right;
            }
            if (this.m_MagnetEngine != null && evt.get_modifiers() != 1)
            {
                this.m_MagnetEngine.Snap(evt.get_delta().x, edges);
            }
        }
Beispiel #2
0
 public TimelineClipHandle(TimelineClipGUI theClip, TimelineClipHandle.DragDirection direction, DragClipHandle clipHandleManipulator)
 {
     this.m_Direction = direction;
     this.m_Clip      = theClip;
     base.AddManipulator(clipHandleManipulator);
 }