Ejemplo n.º 1
0
 /// <summary>
 /// Transposes the ScreenVector if the series is transposed. Reverses the respective direction if X or Y axis are reversed.
 /// </summary>
 /// <param name="element">The <see cref="ITransposablePlotElement" />.</param>
 /// <param name="vector">The <see cref="ScreenVector" /> to orientate.</param>
 /// <returns>The oriented vector.</returns>
 public static ScreenVector Orientate(this ITransposablePlotElement element, ScreenVector vector)
 {
     vector = new ScreenVector(
         element.XAxis.IsReversed ? -vector.X : vector.X,
         element.YAxis.IsReversed ? -vector.Y : vector.Y);
     return(element.IsTransposed() ? new ScreenVector(-vector.Y, -vector.X) : vector);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Orientates a HorizontalAlignment and a VerticalAlignment according to whether the Series is transposed or the Axes are reversed.
        /// </summary>
        /// <param name="element">The <see cref="ITransposablePlotElement" />.</param>
        /// <param name="ha">The <see cref="HorizontalAlignment" /> to orientate.</param>
        /// <param name="va">The <see cref="VerticalAlignment" /> to orientate.</param>
        public static void Orientate(
            this ITransposablePlotElement element,
            ref HorizontalAlignment ha,
            ref VerticalAlignment va)
        {
            if (element.XAxis.IsReversed)
            {
                ha = (HorizontalAlignment)(-(int)ha);
            }

            if (element.YAxis.IsReversed)
            {
                va = (VerticalAlignment)(-(int)va);
            }

            if (element.IsTransposed())
            {
                var orientatedHa = (HorizontalAlignment)(-(int)va);
                va = (VerticalAlignment)(-(int)ha);
                ha = orientatedHa;
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Transposes the ScreenPoint if the series is transposed.
 /// </summary>
 /// <param name="element">The <see cref="ITransposablePlotElement" />.</param>
 /// <param name="point">The <see cref="ScreenPoint" /> to orientate.</param>
 /// <returns>The oriented point.</returns>
 public static ScreenPoint Orientate(this ITransposablePlotElement element, ScreenPoint point)
 {
     return(element.IsTransposed() ? new ScreenPoint(point.Y, point.X) : point);
 }