MCPcopy Index your code
hub / github.com/processing/processing / parseTransform

Method parseTransform

core/src/processing/core/PShapeSVG.java:1062–1077  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 3

PShapeSVGMethod · 0.95
LinearGradientMethod · 0.80
RadialGradientMethod · 0.80

Calls 3

parseSingleTransformMethod · 0.95
applyMethod · 0.95
trimMethod · 0.45

Tested by

no test coverage detected