MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuStyle_measure

Function PiuStyle_measure

modules/piu/All/piuStyle.c:669–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669void PiuStyle_measure(xsMachine* the)
670{
671 PiuStyle* self = PIU(Style, xsThis);
672 (void)xsToString(xsArg(0));
673 if ((*self)->font == NULL)
674 PiuStyleLookupFont(self);
675 if ((*self)->font != NULL) {
676 PiuDimension width = PiuStyleGetWidth(self, &xsArg(0));
677 PiuDimension height = PiuStyleGetHeight(self, &xsArg(0));
678 xsResult = xsNewObject();
679 xsDefine(xsResult, xsID_width, xsPiuDimension(width), xsDefault);
680 xsDefine(xsResult, xsID_height, xsPiuDimension(height), xsDefault);
681 }
682}

Callers

nothing calls this directly

Calls 3

PiuStyleGetWidthFunction · 0.85
PiuStyleGetHeightFunction · 0.85
PiuStyleLookupFontFunction · 0.50

Tested by

no test coverage detected