https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute
| 569 | |
| 570 | // https://www.w3.org/TR/SVG11/coords.html#ViewBoxAttribute |
| 571 | bool SVGAttributeParser::parseViewBox(SVGViewBoxType* vb) { |
| 572 | float x = 0.0f; |
| 573 | float y = 0.0f; |
| 574 | float w = 0.0f; |
| 575 | float h = 0.0f; |
| 576 | this->parseWSToken(); |
| 577 | |
| 578 | bool parsedValue = false; |
| 579 | if (this->parseScalarToken(&x) && this->parseSepToken() && this->parseScalarToken(&y) && |
| 580 | this->parseSepToken() && this->parseScalarToken(&w) && this->parseSepToken() && |
| 581 | this->parseScalarToken(&h)) { |
| 582 | |
| 583 | *vb = static_cast<SVGViewBoxType>(Rect::MakeXYWH(x, y, w, h)); |
| 584 | parsedValue = true; |
| 585 | // consume trailing whitespace |
| 586 | this->parseWSToken(); |
| 587 | } |
| 588 | return parsedValue && this->parseEOSToken(); |
| 589 | } |
| 590 | |
| 591 | template <typename Func, typename T> |
| 592 | bool SVGAttributeParser::parseParenthesized(const char* prefix, Func f, T* result) { |
no test coverage detected