MCPcopy Create free account
hub / github.com/MyGUI/mygui / readTransformationOp

Function readTransformationOp

MyGUIEngine/src/msdfgen/ext/import-svg.cpp:606–628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604void shapeFromSkiaPath(Shape &shape, const SkPath &skPath); // defined in resolve-shape-geometry.cpp
605
606static bool readTransformationOp(SkScalar dst[6], int &count, const char *&str, const char *name) {
607 int nameLen = int(strlen(name));
608 if (!memcmp(str, name, nameLen)) {
609 const char *curStr = str+nameLen;
610 skipExtraChars(curStr);
611 if (*curStr == '(') {
612 skipExtraChars(++curStr);
613 count = 0;
614 while (*curStr && *curStr != ')') {
615 double x;
616 if (!(count < 6 && readDouble(x, curStr)))
617 return false;
618 dst[count++] = SkScalar(x);
619 skipExtraChars(curStr);
620 }
621 if (*curStr == ')') {
622 str = curStr+1;
623 return true;
624 }
625 }
626 }
627 return false;
628}
629
630static SkMatrix parseTransformation(int &flags, const char *str) {
631 SkMatrix transformation;

Callers 1

parseTransformationFunction · 0.85

Calls 2

skipExtraCharsFunction · 0.85
readDoubleFunction · 0.85

Tested by

no test coverage detected