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

Method elementAttribute

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

Source from the content-addressed store, hash-verified

475 }
476
477 inline bool elementAttribute(const char *nameStart, const char *nameEnd, const char *valueStart, const char *valueEnd) {
478 switch (curElement) {
479 case IGNORED:
480 break;
481 case SVG:
482 if (SVG_NAME_IS("width"))
483 dimensions.x = xmlGetDouble(valueStart, valueEnd);
484 else if (SVG_NAME_IS("height"))
485 dimensions.y = xmlGetDouble(valueStart, valueEnd);
486 else if (SVG_NAME_IS("viewBox"))
487 viewBox = StrRange(valueStart, valueEnd);
488 break;
489 case PATH:
490 if (SVG_NAME_IS("d"))
491 pathDefs.push_back(StrRange(valueStart, valueEnd));
492 // fallthrough
493 case G:
494 if (SVG_NAME_IS("transform"))
495 flags |= SVG_IMPORT_TRANSFORMATION_IGNORED_FLAG;
496 break;
497 }
498 return true;
499 }
500
501 inline bool finishAttributes() { return true; }
502 inline bool finish() { return !ignoredDepth; }

Callers

nothing calls this directly

Calls 3

xmlGetDoubleFunction · 0.85
StrRangeClass · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected