Exemplo n.º 1
0
        public static double GetCandidateTime(WindowState state, Vector2?mousePosition, params TrackAsset[] trackAssets)
        {
            // Right-Click
            if (mousePosition != null)
            {
                return(state.GetSnappedTimeAtMousePosition(mousePosition.Value));
            }

            // Playhead
            if (state != null && state.editSequence.director != null)
            {
                return(state.SnapToFrameIfRequired(state.editSequence.time));
            }

            // Specific tracks end
            if (trackAssets != null && trackAssets.Any())
            {
                var items = trackAssets.SelectMany(t => t.GetItems()).ToList();
                return(items.Any() ? items.Max(i => i.end) : 0);
            }

            // Timeline tracks end
            if (state != null && state.editSequence.asset != null)
            {
                return(state.editSequence.asset.flattenedTracks.Any() ? state.editSequence.asset.flattenedTracks.Max(t => t.end) : 0);
            }

            return(0.0);
        }
Exemplo n.º 2
0
        protected override bool MouseDrag(Event evt, WindowState state)
        {
            if (!m_IsCaptured)
            {
                return(false);
            }

            m_OnMouseDrag(state.GetSnappedTimeAtMousePosition(evt.mousePosition));

            return(true);
        }