/// <summary> /// Initializes a new instance of the <see cref="CubicEnvelope" /> class. /// </summary> /// <param name="x">The x.</param> /// <param name="y">The y.</param> /// <param name="width">The width.</param> /// <param name="height">The height.</param> public CubicEnvelope(float x, float y, float width, float height) { var w3 = width * (1f / 3f); var h3 = height * (1f / 3f); // Top Left ControlPointTopLeft = new CubicControlPoint { Point = new PointF(x, y), AnchorA = new PointF(w3, 0f), AnchorB = new PointF(0f, h3) }; // Top Right ControlPointTopRight = new CubicControlPoint { Point = new PointF(x + width, y), AnchorA = new PointF(-w3, 0f), AnchorB = new PointF(0f, h3) }; // Bottom Left ControlPointBottomLeft = new CubicControlPoint { Point = new PointF(x, y + height), AnchorA = new PointF(w3, 0f), AnchorB = new PointF(0f, -h3) }; // Bottom Right ControlPointBottomRight = new CubicControlPoint { Point = new PointF(x + width, y + height), AnchorA = new PointF(-w3, 0f), AnchorB = new PointF(0f, -h3) }; //Update(); }
/// <summary> /// Initializes a new instance of the <see cref="CubicEnvelope" /> struct. /// </summary> /// <param name="controlPointTopLeft">The control point top left.</param> /// <param name="controlPointTopRight">The control point top right.</param> /// <param name="controlPointBottomLeft">The control point bottom left.</param> /// <param name="controlPointBottomRight">The control point bottom right.</param> public CubicEnvelope(CubicControlPoint controlPointTopLeft, CubicControlPoint controlPointTopRight, CubicControlPoint controlPointBottomLeft, CubicControlPoint controlPointBottomRight) { (ControlPointTopLeft, ControlPointTopRight, ControlPointBottomLeft, ControlPointBottomRight) = (controlPointTopLeft, controlPointTopRight, controlPointBottomLeft, controlPointBottomRight); }