/// <summary>
        /// Tries to slide the transition up following the transition arrow to avoid any collision
        /// with the already allocated bounding boxes
        /// </summary>
        /// <param name="transition"></param>
        /// <param name="center"></param>
        /// <returns></returns>
        private Point Slide(TransitionControl transition, Point center, TransitionControl.SlideDirection direction)
        {
            Point     retVal    = center;
            Rectangle colliding = AllocatedBoxes.Intersects(transition.getTextBoundingBox(retVal));

            while (colliding != Rectangle.Empty)
            {
                retVal    = transition.Slide(retVal, colliding, direction);
                colliding = AllocatedBoxes.Intersects(transition.getTextBoundingBox(retVal));
            }

            return(retVal);
        }
Example #2
0
        /// <summary>
        ///     Tries to slide the arrow up following the arrow to avoid any collision
        ///     with the already allocated bounding boxes
        /// </summary>
        /// <param name="allocatedBoxes">The boxes that already have been allocated</param>
        /// <param name="arrow">The arrow to consider</param>
        /// <param name="direction">Indicates whether the sliding should be done upward or downard the arrow orientation</param>
        /// <returns></returns>
        private Point Slide(BoxAllocation allocatedBoxes, ArrowControl <TEnclosing, TBoxModel, TArrowModel> arrow, SlideDirection direction)
        {
            Point retVal = arrow.GetCenter();

            Rectangle colliding = allocatedBoxes.Intersects(arrow.GetTextBoundingBox(retVal));

            while (colliding != Rectangle.Empty)
            {
                retVal    = arrow.Slide(retVal, colliding, direction);
                colliding = allocatedBoxes.Intersects(arrow.GetTextBoundingBox(retVal));
            }

            return(retVal);
        }