| 277 | }; |
| 278 | |
| 279 | static bool getTransform(std::optional<nvg::Transform>& transform, Slice v) { |
| 280 | v.trimSpace(); |
| 281 | std::vector<float> result; |
| 282 | if (v.left(7) == "matrix("_slice && v.right(1) == ")"_slice) { |
| 283 | v.skip(7); |
| 284 | v.skipRight(1); |
| 285 | auto tokens = v.split(" "_slice); |
| 286 | if (tokens.size() == 6) { |
| 287 | nvg::Transform trans = {}; |
| 288 | int i = 0; |
| 289 | for (const auto& token : tokens) { |
| 290 | trans.t[i] = token.toFloat(); |
| 291 | ++i; |
| 292 | } |
| 293 | transform = trans; |
| 294 | return true; |
| 295 | } |
| 296 | } |
| 297 | return false; |
| 298 | } |
| 299 | |
| 300 | void SVGCache::Parser::xmlSAX2StartElement(std::string_view name, const std::vector<std::string_view>& selfAttrs) { |
| 301 | auto def = getItem(); |
no test coverage detected