CurvedEdgeRecord is used to define a curve. Curved lines are constructed using a Quadratic Bezier curve.

The curve is specified using two points relative to the current drawing position, an off-curve control point and an on-curve anchor point which defines the end-point of the curve.

To define a curve the points are defined as pairs of relative coordinates. The control point is specified relative to the current drawing point and the anchor point is specified relative to the control point. Once the line is drawn, the anchor point becomes the current drawing point.

The relative coordinates are specified in twips (where 20 twips = 1 pixel) and must be in the range -65536..65535.

The CurvedEdge record was introduced in Flash 1.

Inheritance: EdgeRecord
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            binaryReader.SynchBits();
            byte numFillBits = (byte)binaryReader.ReadUBits(4);
            byte numLineBits = (byte)binaryReader.ReadUBits(4);

            bool readEndShapeRecord = false;

            while (!readEndShapeRecord)
            {
                bool type  = binaryReader.ReadBoolean();
                byte flags = (byte)binaryReader.ReadUBits(5);

                if (type == false)
                {
                    //Non-edge record
                    if (flags == 0)
                    {
                        //EndShapeRecord
                        readEndShapeRecord = true;
                        this.Add(new EndShapeRecord());
                    }
                    else
                    {
                        //StyleChangerecord
                        StyleChangeRecord styleChange = new StyleChangeRecord();
                        styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType);
                        this.Add(styleChange);
                    }
                }
                else
                {
                    //Edge record
                    if ((flags & 0x10) != 0)
                    {
                        //StraightedEdgeRecord
                        StraightEdgeRecord straight = new StraightEdgeRecord();
                        straight.ReadData(binaryReader, flags);
                        this.Add(straight);
                    }
                    else
                    {
                        //CurvedEdgeRecord
                        CurvedEdgeRecord curved = new CurvedEdgeRecord();
                        curved.ReadData(binaryReader, flags);
                        this.Add(curved);
                    }
                }
            }
        }
        /// <summary>
        /// Reads the data.
        /// </summary>
        /// <param name="binaryReader">Binary reader.</param>
        /// <param name="shapeType">Shape type.</param>
        public void ReadData(BufferedBinaryReader binaryReader, ShapeType shapeType)
        {
            binaryReader.SynchBits();
            byte numFillBits = (byte)binaryReader.ReadUBits(4);
            byte numLineBits = (byte)binaryReader.ReadUBits(4);

            bool readEndShapeRecord = false;
            while (!readEndShapeRecord)
            {
                bool type = binaryReader.ReadBoolean();
                byte flags = (byte)binaryReader.ReadUBits(5);

                if (type == false)
                {
                    //Non-edge record
                    if (flags == 0)
                    {
                        //EndShapeRecord
                        readEndShapeRecord = true;
                        this.Add(new EndShapeRecord());
                        if (log.IsInfoEnabled)
                            log.Info("Shape: EndShapeRecord");
                    }
                    else
                    {
                        //StyleChangerecord
                        StyleChangeRecord styleChange = new StyleChangeRecord();
                        styleChange.ReadData(binaryReader, flags, ref numFillBits, ref numLineBits, shapeType);
                        this.Add(styleChange);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: StyleChangeRecord");
                    }
                }
                else
                {
                    //Edge record
                    if ((flags & 0x10) != 0)
                    {
                        //StraightedEdgeRecord
                        StraightEdgeRecord straight = new StraightEdgeRecord();
                        straight.ReadData(binaryReader, flags);
                        this.Add(straight);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: StraightedEdgeRecord");
                    }
                    else
                    {
                        //CurvedEdgeRecord
                        CurvedEdgeRecord curved = new CurvedEdgeRecord();
                        curved.ReadData(binaryReader, flags);
                        this.Add(curved);
                        if (log.IsInfoEnabled)
                            log.Info("Shape: CurvedEdgeRecord");
                    }
                }
            }
        }