MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / getTransform

Function getTransform

Source/Cache/SVGCache.cpp:279–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277};
278
279static 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
300void SVGCache::Parser::xmlSAX2StartElement(std::string_view name, const std::vector<std::string_view>& selfAttrs) {
301 auto def = getItem();

Callers 7

setPositionMethod · 0.85
setAnchorMethod · 0.85
setWidthMethod · 0.85
setHeightMethod · 0.85
setSizeMethod · 0.85
Node.cppFile · 0.85
xmlSAX2StartElementMethod · 0.85

Calls 7

leftMethod · 0.80
rightMethod · 0.80
skipRightMethod · 0.80
toFloatMethod · 0.80
splitMethod · 0.65
skipMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected