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

Function PiuViewDrawTexture

modules/piu/Pebble/piuView.c:153–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void PiuViewDrawTexture(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
154{
155 PiuDimension tw = (*texture)->width;
156 PiuDimension th = (*texture)->height;
157 if (sx < 0) {
158 x -= sx;
159 sw += sx;
160 sx = 0;
161 }
162 if (sx + sw > tw)
163 sw = tw - sx;
164 if (sy < 0) {
165 y -= sy;
166 sh += sy;
167 sy = 0;
168 }
169 if (sy + sh > th)
170 sh = th - sy;
171 if ((sw <= 0) || (sh <= 0)) return;
172 PiuViewDrawTextureAux(self, texture, x, y, sx, sy, sw, sh);
173}
174
175void PiuViewDrawTextureAux(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
176{

Callers

nothing calls this directly

Calls 1

PiuViewDrawTextureAuxFunction · 0.70

Tested by

no test coverage detected