MCPcopy Create free account
hub / github.com/Tencent/tgfx / parseTranslateToken

Method parseTranslateToken

src/svg/SVGAttributeParser.cpp:635–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

633}
634
635bool SVGAttributeParser::parseTranslateToken(Matrix* matrix) {
636 return this->parseParenthesized(
637 "translate",
638 [this](Matrix* m) -> bool {
639 float tx = 0.0;
640 float ty = 0.0;
641 this->parseWSToken();
642 if (!this->parseScalarToken(&tx)) {
643 return false;
644 }
645
646 if (!this->parseSepToken() || !this->parseScalarToken(&ty)) {
647 ty = 0.0;
648 }
649
650 m->setTranslate(tx, ty);
651 return true;
652 },
653 matrix);
654}
655
656bool SVGAttributeParser::parseScaleToken(Matrix* matrix) {
657 return this->parseParenthesized(

Callers 1

parseMethod · 0.95

Calls 5

parseParenthesizedMethod · 0.95
parseWSTokenMethod · 0.95
parseScalarTokenMethod · 0.95
parseSepTokenMethod · 0.95
setTranslateMethod · 0.80

Tested by

no test coverage detected