Esempio n. 1
0
        private static Matrix parseMultiTransform(String pString)
        {
            var    matcher = MULTITRANSFORM_PATTERN.Match(pString);
            Matrix matrix  = new Matrix();

            while ((matcher = matcher.NextMatch()).Success)
            {
                matrix.PreConcat(SVGTransformParser.parseSingleTransform(matcher.Groups[1].Value));
            }
            return(matrix);
        }
Esempio n. 2
0
        public static Matrix parseTransform(String pString)
        {
            if (pString == null)
            {
                return(null);
            }

            /* If ')' is contained only once, we have a simple/single transform.
             * Otherwise, we have to split multi-transforms like this:
             * "translate(-10,-20) scale(2) rotate(45) translate(5,10)". */
            bool singleTransform = pString.IndexOf(')') == pString.LastIndexOf(')');

            if (singleTransform)
            {
                return(SVGTransformParser.parseSingleTransform(pString));
            }
            else
            {
                return(SVGTransformParser.parseMultiTransform(pString));
            }
        }