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

Function xs_poco_clip

modules/commodetto/commodettoPocoCore.c:579–597  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579void xs_poco_clip(xsMachine *the)
580{
581 Poco poco = xsmcGetHostDataPoco(xsThis);
582 int argc = xsmcArgc;
583
584 if (argc) {
585 PocoCoordinate x, y;
586 PocoDimension w, h;
587
588 x = (PocoCoordinate)xsmcToInteger(xsArg(0)) + poco->xOrigin;
589 y = (PocoCoordinate)xsmcToInteger(xsArg(1)) + poco->yOrigin;
590 w = (PocoDimension)xsmcToInteger(xsArg(2));
591 h = (PocoDimension)xsmcToInteger(xsArg(3));
592 if (PocoClipPush(poco, x, y, w, h))
593 xsmcSetTrue(xsResult);
594 }
595 else
596 PocoClipPop(poco);
597}
598
599void xs_poco_origin(xsMachine *the)
600{

Callers

nothing calls this directly

Calls 2

PocoClipPushFunction · 0.85
PocoClipPopFunction · 0.85

Tested by

no test coverage detected