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

Function PiuPort_drawLabel

modules/piu/All/piuPort.c:184–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184void PiuPort_drawLabel(xsMachine* the)
185{
186 xsIntegerValue c = xsToInteger(xsArgc);
187 PiuPort* self = PIU(Port, xsThis);
188 PiuView* view = (*self)->view;
189 xsSlot* string;
190 PiuRectangleRecord bounds;
191 PiuBoolean ellipsis;
192 if (!view) xsUnknownError("out of sequence");
193 string = PiuString(xsArg(0));
194 bounds.x = xsToPiuCoordinate(xsArg(1));
195 bounds.y = xsToPiuCoordinate(xsArg(2));
196 bounds.width = xsToPiuDimension(xsArg(3));
197 bounds.height = xsToPiuDimension(xsArg(4));
198 ellipsis = (c > 5) ? (PiuBoolean)xsToBoolean(xsArg(5)) : 0;
199 if ((*self)->skin)
200 PiuSkinDraw((*self)->skin, view, &bounds, (*self)->variant, (*self)->state, piuCenter, piuMiddle);
201 if ((*self)->computedStyle)
202 PiuStyleDraw((*self)->computedStyle, string, view, &bounds, ellipsis, (*self)->state);
203}
204
205void PiuPort_drawSkin(xsMachine* the)
206{

Callers

nothing calls this directly

Calls 2

PiuSkinDrawFunction · 0.85
PiuStyleDrawFunction · 0.85

Tested by

no test coverage detected