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

Function PiuQRCodeDraw

modules/piu/Pebble/piuQRCode.c:87–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void PiuQRCodeDraw(void* it, PiuView* view, PiuRectangle area)
88{
89 PiuQRCode* self = it;
90 if ((*self)->buffer) {
91 PiuSkin* skin = (*self)->skin;
92 if (skin) {
93 PiuColorRecord color;
94 PiuState state = (*self)->state;
95 if (state < 0) state = 0;
96 else if (3 < state) state = 3;
97 PiuColorsBlend((*skin)->data.color.fill, state, &color);
98 (*self)->fillColor = GColorFromRGBA(color.r, color.g, color.b, color.a).argb;
99 PiuColorsBlend((*skin)->data.color.stroke, state, &color);
100 (*self)->fillColor = GColorFromRGBA(color.r, color.g, color.b, color.a).argb;
101 }
102 else {
103 (*self)->fillColor = GColorFromRGBA(255, 255, 255, 255).argb;
104 (*self)->strokeColor = GColorFromRGBA(0, 0, 0, 255).argb;
105 }
106 PiuViewDrawContent(view, PiuQRCodeDrawAux, it, 0, 0, (*self)->bounds.width, (*self)->bounds.height);
107 }
108}
109
110void PiuQRCodeDrawAux(void* it, PiuView* view, PiuCoordinate x, PiuCoordinate y, PiuDimension sw, PiuDimension sh)
111{

Callers

nothing calls this directly

Calls 2

PiuColorsBlendFunction · 0.85
PiuViewDrawContentFunction · 0.70

Tested by

no test coverage detected