void AdjustTicks()
        {
            if (TaggedClip == null)
            {
                return;
            }

            float startOfClipPos = TimeToLocalPos(0f);
            float endOfClipPos   = TimeToLocalPos(TaggedClip.Clip.DurationInSeconds);

            m_ClipLengthBar.style.left  = startOfClipPos;
            m_ClipLengthBar.style.width = endOfClipPos - startOfClipPos;

            m_ClipArea.style.left   = startOfClipPos;
            m_ClipArea.style.width  = endOfClipPos - startOfClipPos;
            m_ClipArea.style.height = m_TimelineScrollableArea.layout.height;
            AdjustTagBackgrounds();

            AnnotationsTrack annotationsTrack = null;
            float            takenHeight      = 0f;

            foreach (var track in m_TrackElements)
            {
                if (track is AnnotationsTrack at)
                {
                    annotationsTrack = at;
                }
                else
                {
                    takenHeight += track.layout.height;
                }
            }

            annotationsTrack.style.minHeight = Math.Max(m_ScrollViewContainer.layout.height - takenHeight, 0f);
        }
Exemple #2
0
        void CreateBuiltInTracks()
        {
            m_MetricsTrack = new MetricsTrack(this);
            AddGutterTrack(m_MetricsTrack);

            m_AnnotationsTrack = new AnnotationsTrack(this);
            AddTrack(m_AnnotationsTrack);

            m_ScrollViewContainer.AddManipulator(new TagCreationManipulator(this, m_AnnotationsTrack));

            m_BoundaryClipTrack = new BoundaryClipTrack(this);
            AddGutterTrack(m_BoundaryClipTrack);

            m_MarkerTrack = new MarkerTrack(this);
            AddGutterTrack(m_MarkerTrack);
        }