Ejemplo n.º 1
0
        /// <summary>
        /// Creates a Bezier curve between the current point and the point given as a
        /// parameter.
        /// </summary>
        /// <param name="nextPoint"></param>
        public void CreateBezier(ShapePointBase nextPoint)
        {
            LineDirections dir = GetLineDirection(nextPoint);

            ControlPoint1.Set(X + 10, Y);
            ControlPoint2.Set(nextPoint.X - 10, nextPoint.Y);
        }
Ejemplo n.º 2
0
 /// <inheritdoc/>
 public override int GetHashCode() => ControlPoint1.GetHashCode() ^ ControlPoint2.GetHashCode();
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public bool Equals(CubicBezierEasing other) =>
 ReferenceEquals(this, other) ||
 (other is CubicBezierEasing &&
  ControlPoint1.Equals(other.ControlPoint1) &&
  ControlPoint2.Equals(other.ControlPoint2));
Ejemplo n.º 4
0
 public IPathInstruction RotateAbout(Coordinate rotationOrigin, Angle angle) =>
 new CubicPathInstruction(
     EndPosition.RotateAbout(rotationOrigin, angle),
     ControlPoint1.RotateAbout(rotationOrigin, angle),
     ControlPoint2.RotateAbout(rotationOrigin, angle));
 /// <summary>
 /// 创建用于 Composition API 的 CompositionEasingFunction。
 /// </summary>
 /// <param name="compositor"></param>
 /// <returns></returns>
 public override CompositionEasingFunction CreateCompositionEasingFunction(Compositor compositor)
 {
     return(compositor.CreateCubicBezierEasingFunction(ControlPoint1.ToVector2(), ControlPoint2.ToVector2()));
 }