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

Function PiuDieUpdate

modules/piu/MC/piuDie.c:64–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62}
63
64void PiuDieUpdate(void* it, PiuView* view, PiuRectangle area)
65{
66 PiuDie* self = it;
67 PiuCoordinate x = (*self)->bounds.x;
68 PiuCoordinate y = (*self)->bounds.y;
69 PiuRegion* current = (*self)->current;
70 PiuCoordinate *regionBegin0, *region0, *regionLimit0;
71 int size, offset;
72 PiuContent* content;
73 PiuViewPushOrigin(view, x, y);
74 PiuRectangleOffset(area, -x, -y);
75 regionBegin0 = (*current)->data;;
76 offset = 5;
77 size = *regionBegin0 - 2; // last span
78 region0 = regionBegin0 + offset;
79 regionLimit0 = regionBegin0 + size;
80 while (region0 < regionLimit0) {
81 PiuCoordinate top = *region0++;
82 PiuCoordinate segmentCount = *region0++;
83 PiuCoordinate bottom = *(region0 + segmentCount);
84 while (segmentCount) {
85 PiuCoordinate left = *region0++;
86 segmentCount--;
87 PiuCoordinate right = *region0++;
88 segmentCount--;
89 offset = (int)(region0 - regionBegin0);
90
91 PiuViewPushClip(view, left, top, right - left, bottom - top);
92 (*(*self)->dispatch->draw)(self, view, area);
93 content = (*self)->first;
94 while (content) {
95 (*(*content)->dispatch->update)(content, view, area);
96 content = (*content)->next;
97 }
98 PiuViewPopClip(view);
99
100 regionBegin0 = (*current)->data;;
101 region0 = regionBegin0 + offset;
102 regionLimit0 = regionBegin0 + size;
103 }
104 }
105 PiuRectangleOffset(area, x, y);
106 PiuViewPopOrigin(view);
107}
108
109void PiuDie__create(xsMachine* the)
110{

Callers

nothing calls this directly

Calls 5

PiuRectangleOffsetFunction · 0.85
PiuViewPushOriginFunction · 0.70
PiuViewPushClipFunction · 0.70
PiuViewPopClipFunction · 0.70
PiuViewPopOriginFunction · 0.70

Tested by

no test coverage detected