示例#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>();
        }
示例#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);
    }
示例#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);
    }
示例#4
0
    private void SetStrokeLineJoin(string lineCapType)
    {
        switch (lineCapType)
        {
        case "miter": _strokeLineJoin = SVGStrokeLineJoinMethod.Miter; break;

        case "round": _strokeLineJoin = SVGStrokeLineJoinMethod.Round; break;

        case "bevel": _strokeLineJoin = SVGStrokeLineJoinMethod.Bevel; break;
        }
    }
 public static StrokeLineJoin GetStrokeLineJoin(SVGStrokeLineJoinMethod capMethod)
 {
     switch(capMethod)
     {
         case SVGStrokeLineJoinMethod.Miter:
             return StrokeLineJoin.miter;
         case SVGStrokeLineJoinMethod.MiterClip:
             return StrokeLineJoin.miterClip;
         case SVGStrokeLineJoinMethod.Round:
             return StrokeLineJoin.round;
         case SVGStrokeLineJoinMethod.Bevel:
             return StrokeLineJoin.bevel;
     }
     
     return StrokeLineJoin.bevel;
 }
示例#6
0
        public static StrokeLineJoin GetStrokeLineJoin(SVGStrokeLineJoinMethod capMethod)
        {
            switch (capMethod)
            {
            case SVGStrokeLineJoinMethod.Miter:
                return(StrokeLineJoin.miter);

            case SVGStrokeLineJoinMethod.MiterClip:
                return(StrokeLineJoin.miterClip);

            case SVGStrokeLineJoinMethod.Round:
                return(StrokeLineJoin.round);

            case SVGStrokeLineJoinMethod.Bevel:
                return(StrokeLineJoin.bevel);
            }

            return(StrokeLineJoin.bevel);
        }
示例#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);
        }
    }
示例#8
0
 private void SetStrokeLineJoin(string lineCapType)
 {
     switch(lineCapType) {
       case "miter" :   _strokeLineJoin = SVGStrokeLineJoinMethod.Miter;  break;
       case "round" :  _strokeLineJoin = SVGStrokeLineJoinMethod.Round;  break;
       case "bevel" :   _strokeLineJoin = SVGStrokeLineJoinMethod.Bevel;  break;
     }
 }
示例#9
0
 public void SetStrokeLineJoin(SVGStrokeLineJoinMethod strokeLineJoin)
 {
     this._strokeLineJoin = strokeLineJoin;
 }
示例#10
0
 //--------------------------------------------------------------------------------
 //Method: SetStrokeLineJoin
 //--------------------------------------------------------------------------------
 public void SetStrokeLineJoin(SVGStrokeLineJoinMethod strokeLineJoin)
 {
     this._strokeLineJoin = strokeLineJoin;
 }
示例#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;
            }
        }
示例#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>();
        }
示例#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);
        }