Exemplo n.º 1
0
        void InitDefaults()
        {
            isStrokeWidth = false;

            this._visibility      = SVGVisibility.Visible;
            this._display         = SVGDisplay.Inline;
            this._overflow        = SVGOverflow.visible;
            this._clipPathUnits   = SVGClipPathUnits.UserSpaceOnUse;
            this._clipRule        = SVGClipRule.nonzero;
            this._opacity         = 1f;
            this._fillOpacity     = 1f;
            this._strokeOpacity   = 1f;
            this._fillColor       = new SVGColor();
            this._strokeColor     = new SVGColor();
            this._strokeWidth     = new SVGLength(1);
            this._strokeLineJoin  = SVGStrokeLineJoinMethod.Miter;
            this._strokeLineCap   = SVGStrokeLineCapMethod.Butt;
            this._fillRule        = SVGFillRule.NonZero;
            this._miterLimit      = new SVGLength(4);
            this._dashArray       = null;
            this._dashOfset       = new SVGLength(0);
            this._cssStyle        = new Dictionary <string, Dictionary <string, string> >();
            this._clipPathList    = new List <List <Vector2> >();
            this._linearGradList  = new Dictionary <string, SVGLinearGradientElement>();
            this._radialGradList  = new Dictionary <string, SVGRadialGradientElement>();
            this._conicalGradList = new Dictionary <string, SVGConicalGradientElement>();
        }
Exemplo n.º 2
0
    public SVGPaintable(SVGPaintable inheritPaintable, AttributeList attrList)
    {
        this._linearGradList = inheritPaintable.linearGradList;
        this._radialGradList = inheritPaintable.radialGradList;;
        Initialize(attrList);

        if(IsFillX() == false) {
          if(inheritPaintable.IsLinearGradiantFill()) {
        this._gradientID = inheritPaintable.gradientID;
          } else if(inheritPaintable.IsRadialGradiantFill()) {
        this._gradientID = inheritPaintable.gradientID;
          } else this._fillColor = inheritPaintable.fillColor;
        }
        if(!IsStroke()&& inheritPaintable.IsStroke()) {
          this._strokeColor = inheritPaintable.strokeColor;
        }

        if(_strokeLineCap == SVGStrokeLineCapMethod.Unknown) {
          _strokeLineCap = inheritPaintable.strokeLineCap;
        }

        if(_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown) {
          _strokeLineJoin = inheritPaintable.strokeLineJoin;
        }

        if(isStrokeWidth == false)
          this._strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);
    }
Exemplo n.º 3
0
    public SVGPaintable(SVGPaintable inheritPaintable, Dictionary<string, string> attrList)
    {
        _linearGradList = inheritPaintable.linearGradList;
        _radialGradList = inheritPaintable.radialGradList;
        Initialize(attrList);

        if(IsFillX() == false) {
          if(inheritPaintable.IsLinearGradiantFill())
        _gradientID = inheritPaintable.gradientID;
          else if(inheritPaintable.IsRadialGradiantFill())
        _gradientID = inheritPaintable.gradientID;
          else
        _fillColor = inheritPaintable.fillColor;
        }
        if(!IsStroke() && inheritPaintable.IsStroke())
          _strokeColor = inheritPaintable.strokeColor;

        if(_strokeLineCap == SVGStrokeLineCapMethod.Unknown)
          _strokeLineCap = inheritPaintable.strokeLineCap;

        if(_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown)
          _strokeLineJoin = inheritPaintable.strokeLineJoin;

        if(isStrokeWidth == false)
          _strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);
    }
Exemplo n.º 4
0
    private void SetStrokeLineCap(string lineCapType)
    {
        switch (lineCapType)
        {
        case "butt": _strokeLineCap = SVGStrokeLineCapMethod.Butt; break;

        case "round": _strokeLineCap = SVGStrokeLineCapMethod.Round; break;

        case "square": _strokeLineCap = SVGStrokeLineCapMethod.Square; break;
        }
    }
Exemplo n.º 5
0
        public static StrokeLineCap GetStrokeLineCap(SVGStrokeLineCapMethod capMethod)
        {
            switch(capMethod)
            {
                case SVGStrokeLineCapMethod.Butt:
                    return StrokeLineCap.butt;
                case SVGStrokeLineCapMethod.Round:
                    return StrokeLineCap.round;
                case SVGStrokeLineCapMethod.Square:
                    return StrokeLineCap.square;
            }

            return StrokeLineCap.butt;
        }
Exemplo n.º 6
0
        public static StrokeLineCap GetStrokeLineCap(SVGStrokeLineCapMethod capMethod)
        {
            switch (capMethod)
            {
            case SVGStrokeLineCapMethod.Butt:
                return(StrokeLineCap.butt);

            case SVGStrokeLineCapMethod.Round:
                return(StrokeLineCap.round);

            case SVGStrokeLineCapMethod.Square:
                return(StrokeLineCap.square);
            }

            return(StrokeLineCap.butt);
        }
Exemplo n.º 7
0
    public SVGPaintable(SVGPaintable inheritPaintable, Dictionary <string, string> attrList)
    {
        _linearGradList = inheritPaintable.linearGradList;
        _radialGradList = inheritPaintable.radialGradList;
        Initialize(attrList);

        if (IsFillX() == false)
        {
            if (inheritPaintable.IsLinearGradiantFill())
            {
                _gradientID = inheritPaintable.gradientID;
            }
            else if (inheritPaintable.IsRadialGradiantFill())
            {
                _gradientID = inheritPaintable.gradientID;
            }
            else
            {
                _fillColor = inheritPaintable.fillColor;
            }
        }
        if (!IsStroke() && inheritPaintable.IsStroke())
        {
            _strokeColor = inheritPaintable.strokeColor;
        }

        if (_strokeLineCap == SVGStrokeLineCapMethod.Unknown)
        {
            _strokeLineCap = inheritPaintable.strokeLineCap;
        }

        if (_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown)
        {
            _strokeLineJoin = inheritPaintable.strokeLineJoin;
        }

        if (isStrokeWidth == false)
        {
            _strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);
        }
    }
Exemplo n.º 8
0
 /***********************************************************************************/
 private void SetStrokeLineCap(string lineCapType)
 {
     switch(lineCapType) {
       case "butt" :   _strokeLineCap = SVGStrokeLineCapMethod.Butt;  break;
       case "round" :  _strokeLineCap = SVGStrokeLineCapMethod.Round;  break;
       case "square" : _strokeLineCap = SVGStrokeLineCapMethod.Square;break;
     }
 }
Exemplo n.º 9
0
 public void SetStrokeLineCap(SVGStrokeLineCapMethod strokeLineCap)
 {
     this._strokeLineCap = strokeLineCap;
 }
Exemplo n.º 10
0
 //--------------------------------------------------------------------------------
 //Method: SetStrokeLineCap
 //--------------------------------------------------------------------------------
 public void SetStrokeLineCap(SVGStrokeLineCapMethod strokeLineCap)
 {
     this._strokeLineCap = strokeLineCap;
 }
Exemplo n.º 11
0
        public SVGPaintable(SVGPaintable inheritPaintable, Node node)
        {
            InitDefaults();

            if (inheritPaintable != null)
            {
                this._visibility      = inheritPaintable.visibility;
                this._display         = inheritPaintable.display;
                this._clipRule        = inheritPaintable.clipRule;
                this._viewport        = inheritPaintable._viewport;
                this._fillRule        = inheritPaintable._fillRule;
                this._cssStyle        = inheritPaintable._cssStyle;
                this._clipPathList    = CloneClipPathList(inheritPaintable._clipPathList);
                this._linearGradList  = inheritPaintable._linearGradList;
                this._radialGradList  = inheritPaintable._radialGradList;
                this._conicalGradList = inheritPaintable._conicalGradList;
            }

            if (inheritPaintable != null)
            {
                if (IsFillX() == false)
                {
                    if (inheritPaintable.IsLinearGradiantFill())
                    {
                        this._gradientID = inheritPaintable.gradientID;
                    }
                    else if (inheritPaintable.IsRadialGradiantFill())
                    {
                        this._gradientID = inheritPaintable.gradientID;
                    }
                    else
                    {
                        this._fillColor = inheritPaintable.fillColor;
                    }
                }

                if (!IsStroke() && inheritPaintable.IsStroke())
                {
                    this._strokeColor = inheritPaintable.strokeColor;
                }

                if (_strokeLineCap == SVGStrokeLineCapMethod.Unknown)
                {
                    _strokeLineCap = inheritPaintable.strokeLineCap;
                }

                if (_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown)
                {
                    _strokeLineJoin = inheritPaintable.strokeLineJoin;
                }

                if (isStrokeWidth == false)
                {
                    this._strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);
                }
            }

            Initialize(node.attributes);
            ReadCSS(node);

            if (inheritPaintable != null)
            {
                _opacity       *= inheritPaintable._opacity;
                _fillOpacity   *= inheritPaintable._fillOpacity;
                _strokeOpacity *= inheritPaintable._strokeOpacity;
            }
        }
Exemplo n.º 12
0
        void InitDefaults()
        {
            isStrokeWidth = false;

            this._visibility = SVGVisibility.Visible;
            this._display = SVGDisplay.Inline;
            this._overflow = SVGOverflow.visible;
            this._clipPathUnits = SVGClipPathUnits.UserSpaceOnUse;
            this._clipRule = SVGClipRule.nonzero;
            this._opacity = 1f;
            this._fillOpacity = 1f;
            this._strokeOpacity = 1f;
            this._fillColor = new SVGColor();
            this._strokeColor = new SVGColor();
            this._strokeWidth = new SVGLength(1);
            this._strokeLineJoin = SVGStrokeLineJoinMethod.Miter;
            this._strokeLineCap = SVGStrokeLineCapMethod.Butt;
            this._fillRule = SVGFillRule.NonZero;
            this._miterLimit = new SVGLength(4);
            this._dashArray = null;
            this._dashOfset = new SVGLength(0);
            this._cssStyle = new Dictionary<string, Dictionary<string, string>>();
            this._clipPathList = new List<List<Vector2>>();
            this._linearGradList = new Dictionary<string, SVGLinearGradientElement>();
            this._radialGradList = new Dictionary<string, SVGRadialGradientElement>();
            this._conicalGradList = new Dictionary<string, SVGConicalGradientElement>();
        }
Exemplo n.º 13
0
        public SVGPaintable(SVGPaintable inheritPaintable, Node node)
        {
            InitDefaults();

            if(inheritPaintable != null)
            {
                this._visibility = inheritPaintable.visibility;
                this._display = inheritPaintable.display;
                this._clipRule = inheritPaintable.clipRule;
                this._viewport = inheritPaintable._viewport;
                this._fillRule = inheritPaintable._fillRule;
                this._cssStyle = inheritPaintable._cssStyle;
                this._clipPathList = CloneClipPathList(inheritPaintable._clipPathList);
                this._linearGradList = inheritPaintable._linearGradList;
                this._radialGradList = inheritPaintable._radialGradList;
                this._conicalGradList = inheritPaintable._conicalGradList;
            }

            Initialize(node.attributes);

            if(inheritPaintable != null)
            {
                if (IsFillX() == false)
                {
                    if (inheritPaintable.IsLinearGradiantFill())
                    {
                        this._gradientID = inheritPaintable.gradientID;
                    } else if (inheritPaintable.IsRadialGradiantFill())
                    {
                        this._gradientID = inheritPaintable.gradientID;
                    } else
                        this._fillColor = inheritPaintable.fillColor;
                }

                if (!IsStroke() && inheritPaintable.IsStroke())
                {
                    this._strokeColor = inheritPaintable.strokeColor;
                }

                if (_strokeLineCap == SVGStrokeLineCapMethod.Unknown)
                {
                    _strokeLineCap = inheritPaintable.strokeLineCap;
                }

                if (_strokeLineJoin == SVGStrokeLineJoinMethod.Unknown)
                {
                    _strokeLineJoin = inheritPaintable.strokeLineJoin;
                }

                if (isStrokeWidth == false)
                    this._strokeWidth.NewValueSpecifiedUnits(inheritPaintable.strokeWidth);

                _opacity *= inheritPaintable._opacity;
                _fillOpacity *= inheritPaintable._fillOpacity;
                _strokeOpacity *= inheritPaintable._strokeOpacity;
            }

            ReadCSS(node);
        }