Exemplo n.º 1
0
 private void RecomputeRectUnions(TimelineWindow.TimelineState state)
 {
     this.m_MustRecomputeUnions = false;
     this.m_Unions.Clear();
     if (this.get_children() != null)
     {
         foreach (TreeViewItem current in this.get_children())
         {
             TimelineTrackGUI timelineTrackGUI = current as TimelineTrackGUI;
             if (timelineTrackGUI != null)
             {
                 timelineTrackGUI.RebuildGUICache(state);
                 this.m_Unions.AddRange(TimelineClipUnion.Build(timelineTrackGUI.clips));
             }
         }
     }
 }
        public static List <TimelineClipUnion> Build(List <TimelineClipGUI> clips)
        {
            List <TimelineClipUnion> list = new List <TimelineClipUnion>();
            List <TimelineClipUnion> result;

            if (clips == null)
            {
                result = list;
            }
            else
            {
                TimelineClipUnion timelineClipUnion = null;
                foreach (TimelineClipGUI current in clips)
                {
                    Rect rect;
                    if (timelineClipUnion == null)
                    {
                        timelineClipUnion = new TimelineClipUnion();
                        timelineClipUnion.Add(current);
                        list.Add(timelineClipUnion);
                    }
                    else if (RectUtils.Intersection(current.bounds, timelineClipUnion.m_BoundingRect, ref rect))
                    {
                        timelineClipUnion.Add(current);
                    }
                    else
                    {
                        timelineClipUnion = new TimelineClipUnion();
                        timelineClipUnion.Add(current);
                        list.Add(timelineClipUnion);
                    }
                }
                result = list;
            }
            return(result);
        }