SWFProcessing.SWFModeller.Characters.Shapes.IO.ShapeParser.ReadLineStyle2 C# (CSharp) Method

ReadLineStyle2() private method

private ReadLineStyle2 ( SWFDataTypeReader shapeReader, Tag format ) : LineStyle
shapeReader SWFDataTypeReader
format Tag
return SWFProcessing.SWFModeller.Characters.Shapes.Parts.LineStyle
        private LineStyle ReadLineStyle2(SWFDataTypeReader shapeReader, Tag format)
        {
            int width = shapeReader.ReadUI16();
            CapStyle startCap = (CapStyle)shapeReader.ReadUBits(2);
            JoinStyle join = (JoinStyle)shapeReader.ReadUBits(2);
            bool hasFill = shapeReader.ReadBit();
            bool noHScaling = shapeReader.ReadBit();
            bool noVScaling = shapeReader.ReadBit();
            bool hasPixelHints = shapeReader.ReadBit();
            shapeReader.ReadUBits(5); /* Reserved: 0 */
            bool noClose = shapeReader.ReadBit();
            CapStyle endCap = (CapStyle)shapeReader.ReadUBits(2);

            int? miterLimit = null;
            if (join == JoinStyle.Miter)
            {
                miterLimit = shapeReader.ReadUI16();
            }

            Color? c = null;
            FillStyle fs = null;

            if (hasFill)
            {
                fs = this.ReadFillStyle(shapeReader, format);
            }
            else
            {
                c = shapeReader.ReadRGBA();
            }

            return new LineStyle()
            {
                Width = width,
                StartCap = startCap,
                EndCap = endCap,
                Join = join,
                HasFill = hasFill,
                NoHScaling = noHScaling,
                NoVScaling = noVScaling,
                HasPixelHints = hasPixelHints,
                Colour = c,
                FillStyle = fs,
                MiterLimit = miterLimit
            };
        }