Parse the specified SVG matrix into a PMatrix2D. Note that PMatrix2D is rotated relative to the SVG definition, so parameters are rearranged here. More about the transformation matrices in this section of the SVG documentation. @p
(String matrixStr)
| 1067 | * @return a good old-fashioned PMatrix2D |
| 1068 | */ |
| 1069 | static protected PMatrix2D parseTransform(String matrixStr) { |
| 1070 | matrixStr = matrixStr.trim(); |
| 1071 | PMatrix2D outgoing = null; |
| 1072 | int start = 0; |
| 1073 | int stop = -1; |
| 1074 | while ((stop = matrixStr.indexOf(')', start)) != -1) { |
| 1075 | PMatrix2D m = parseSingleTransform(matrixStr.substring(start, stop+1)); |
| 1076 | if (outgoing == null) { |
| 1077 | outgoing = m; |
| 1078 | } else { |
| 1079 | outgoing.apply(m); |
| 1080 | } |
| 1081 | start = stop + 1; |
| 1082 | } |
| 1083 | return outgoing; |
| 1084 | } |
| 1085 | |
| 1086 | |
| 1087 | static protected PMatrix2D parseSingleTransform(String matrixStr) { |
no test coverage detected