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)
| 1060 | * @return a good old-fashioned PMatrix2D |
| 1061 | */ |
| 1062 | static protected PMatrix2D parseTransform(String matrixStr) { |
| 1063 | matrixStr = matrixStr.trim(); |
| 1064 | PMatrix2D outgoing = null; |
| 1065 | int start = 0; |
| 1066 | int stop = -1; |
| 1067 | while ((stop = matrixStr.indexOf(')', start)) != -1) { |
| 1068 | PMatrix2D m = parseSingleTransform(matrixStr.substring(start, stop+1)); |
| 1069 | if (outgoing == null) { |
| 1070 | outgoing = m; |
| 1071 | } else { |
| 1072 | outgoing.apply(m); |
| 1073 | } |
| 1074 | start = stop + 1; |
| 1075 | } |
| 1076 | return outgoing; |
| 1077 | } |
| 1078 | |
| 1079 | |
| 1080 | static protected PMatrix2D parseSingleTransform(String matrixStr) { |
no test coverage detected