Beispiel #1
0
        /// <summary>
        /// Draws the snap-to indicator to give the user a visual cue that snapping is occurring</summary>
        /// <param name="sender">The TimelineControl whose Paint event is being raised</param>
        /// <param name="e">The paint event args</param>
        /// <remarks>Draws a vertical line at the snapping location</remarks>
        private void owner_DrawingD2d(object sender, EventArgs e)
        {
            if (m_snapInfo.Count == 0)
            {
                return;
            }

            D2dGraphics g             = m_owner.D2dGraphics;
            Rectangle   clipRectangle = m_owner.VisibleClientRectangle;

            try
            {
                g.PushAxisAlignedClip(clipRectangle);
                Matrix worldToView = m_owner.Transform;

                foreach (SnapOffsetInfo info in m_snapInfo)
                {
                    float viewXCoord = GdiUtil.Transform(worldToView, info.SnapToPoint);
                    g.DrawLine(viewXCoord, clipRectangle.Top, viewXCoord, clipRectangle.Bottom, s_color, 3.0f, null);
                }
            }
            finally
            {
                g.PopAxisAlignedClip();
            }
        }
Beispiel #2
0
        private void owner_DrawingD2d(object sender, EventArgs e)
        {
            // Tighten clipping region. The TimelineRenderer assumes that it has to shrink the current
            //  Graphics.Clip region by the header width.
            D2dGraphics g             = Owner.D2dGraphics;
            Rectangle   clipRectangle = Owner.VisibleClientRectangle;

            try
            {
                g.PushAxisAlignedClip(clipRectangle);
                DrawManipulator(g, out m_handleRect);
            }
            finally
            {
                g.PopAxisAlignedClip();
            }
        }
        private void owner_DrawingD2d(object sender, EventArgs e)
        {
            // Test if anything is visible.
            m_visibleManipulator =
                D2dTimelineControl.CalculateRange(Owner.EditableSelection, out m_worldMin, out m_worldMax);
            if (!m_visibleManipulator)
            {
                return;
            }

            D2dGraphics g           = Owner.D2dGraphics;
            Matrix      worldToView = Owner.Transform;

            // Make the TimelineRenderer draw the ghosts, if necessary. Must happen before
            //  the manipulator is drawn so that snap-to info is created.
            if (IsScaling)
            {
                TimelineLayout layout = Owner.GetLayout();

                GhostInfo[] ghosts = m_resizer.CreateGhostInfo(
                    layout,
                    Owner.GetDragOffset().X,
                    worldToView);

                Owner.Renderer.DrawGhosts(
                    ghosts,
                    DraggedSide,
                    worldToView,
                    Owner.ClientRectangle);
            }

            // Tighten clipping region. Has to occur after DrawGhosts because the TimelineRenderer
            //  assumes that it has to shrink the current Graphics.Clip region by the header width.
            try
            {
                g.PushAxisAlignedClip(Owner.VisibleClientRectangle);

                // Draw the manipulator, giving client code a customization point.
                DrawManipulator(g, out m_leftHandle, out m_rightHandle);
            }
            finally
            {
                g.PopAxisAlignedClip();
            }
        }