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

Function PiuPort_drawStyle

modules/piu/All/piuPort.c:250–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250void PiuPort_drawStyle(xsMachine* the)
251{
252 xsIntegerValue c = xsToInteger(xsArgc);
253 PiuPort* self = PIU(Port, xsThis);
254 PiuView* view = (*self)->view;
255 xsSlot* string;
256 PiuStyle* style;
257 PiuRectangleRecord bounds;
258 PiuBoolean ellipsis;
259 PiuState state;
260 if (!view) xsUnknownError("out of sequence");
261 style = PIU(Style, xsArg(1));
262 if ((*style)->font == NULL)
263 PiuStyleLookupFont(style);
264 string = PiuString(xsArg(0));
265 bounds.x = xsToPiuCoordinate(xsArg(2));
266 bounds.y = xsToPiuCoordinate(xsArg(3));
267 bounds.width = xsToPiuDimension(xsArg(4));
268 bounds.height = xsToPiuDimension(xsArg(5));
269 ellipsis = (c > 6) ? (PiuBoolean)xsToBoolean(xsArg(6)) : 0;
270 state = (c > 7) ? (PiuState)xsToNumber(xsArg(7)) : 0;
271 PiuStyleDraw(style, string, view, &bounds, ellipsis, state);
272}
273
274void PiuPort_drawTexture(xsMachine* the)
275{

Callers

nothing calls this directly

Calls 2

PiuStyleDrawFunction · 0.85
PiuStyleLookupFontFunction · 0.50

Tested by

no test coverage detected