Example #1
0
        private void RenderSelectionOverlay(Rect rect)
        {
            if (m_State.showCurveEditor && !m_CurveEditor.hasSelection)
            {
                return;
            }

            if (!m_State.showCurveEditor && m_State.selectedKeys.Count == 0)
            {
                return;
            }

            const int kOverlayMinWidth = 14;

            Bounds bounds = m_State.showCurveEditor ? m_CurveEditor.selectionBounds : m_State.selectionBounds;

            float startPixel = m_State.TimeToPixel(bounds.min.x) + rect.xMin;
            float endPixel   = m_State.TimeToPixel(bounds.max.x) + rect.xMin;

            if ((endPixel - startPixel) < kOverlayMinWidth)
            {
                float centerPixel = (startPixel + endPixel) * 0.5f;

                startPixel = centerPixel - kOverlayMinWidth * 0.5f;
                endPixel   = centerPixel + kOverlayMinWidth * 0.5f;
            }

            AnimationWindowUtility.DrawSelectionOverlay(rect, selectionRangeColor, startPixel, endPixel);
        }
Example #2
0
 private void RenderSelectionOverlay(Rect rect)
 {
     if (!this.m_State.showCurveEditor || this.m_CurveEditor.hasSelection)
     {
         if (this.m_State.showCurveEditor || this.m_State.selectedKeys.Count != 0)
         {
             Bounds bounds = (!this.m_State.showCurveEditor) ? this.m_State.selectionBounds : this.m_CurveEditor.selectionBounds;
             float  num    = this.m_State.TimeToPixel(bounds.min.x) + rect.xMin;
             float  num2   = this.m_State.TimeToPixel(bounds.max.x) + rect.xMin;
             if (num2 - num < 14f)
             {
                 float num3 = (num + num2) * 0.5f;
                 num  = num3 - 7f;
                 num2 = num3 + 7f;
             }
             AnimationWindowUtility.DrawSelectionOverlay(rect, AnimEditor.selectionRangeColor, num, num2);
         }
     }
 }