コード例 #1
0
        /// <summary>
        ///     Adds the line to the given <paramref name="path" /> after transforming it by the given
        ///     <paramref name="transform" />.
        /// </summary>
        /// <param name="path">The path to add the line to.</param>
        /// <param name="transform">The transform.</param>
        /// <param name="reverse">If set to <see langword="true" />, add the line from <see cref="Start" /> to <see cref="End" />.</param>
        public void AddToPath(IGraphicsPath path, Matrix3x2 transform, bool reverse)
        {
            if (path == null)
            {
                throw new ArgumentNullException(nameof(path));
            }

            path.AddCubicBezier(
                Vector2.Transform(reverse ? ControlPointB : ControlPointA, transform),
                Vector2.Transform(reverse ? ControlPointA : ControlPointB, transform),
                Vector2.Transform(reverse ? Start : End, transform));
        }
コード例 #2
0
        /// <summary>
        ///     Adds the line to the given <paramref name="path" /> after transforming it by the given
        ///     <paramref name="transform" />.
        /// </summary>
        /// <param name="path">The path to add the line to.</param>
        /// <param name="transform">The transform.</param>
        /// <param name="reverse">If set to <see langword="true" />, add the line from <see cref="Start" /> to <see cref="End" />.</param>
        public void AddToPath(IGraphicsPath path, Matrix3x2 transform, bool reverse)
        {
            if (path == null) throw new ArgumentNullException(nameof(path));

            path.AddCubicBezier(
                Vector2.Transform(reverse ? ControlPointB : ControlPointA, transform),
                Vector2.Transform(reverse ? ControlPointA : ControlPointB, transform),
                Vector2.Transform(reverse ? Start : End, transform));
        }