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

Function PiuShapeDraw

modules/piu/MC/outline/piuShape.c:98–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

96}
97
98void PiuShapeDraw(void* it, PiuView* view, PiuRectangle area)
99{
100 PiuShape* self = it;
101 PiuSkin* skin = (*self)->skin;
102 if (skin) {
103 PiuColorRecord color;
104 PiuState state = (*self)->state;
105 if (state < 0) state = 0;
106 else if (3 < state) state = 3;
107 if ((*self)->fillOutline) {
108 PiuColorsBlend((*skin)->data.color.fill, state, &color);
109 (*self)->fillColor = PocoMakeColor((*view)->poco, color.r, color.g, color.b);
110 (*self)->fillBlend = color.a;
111 }
112 if ((*self)->strokeOutline) {
113 PiuColorsBlend((*skin)->data.color.stroke, state, &color);
114 (*self)->strokeColor = PocoMakeColor((*view)->poco, color.r, color.g, color.b);
115 (*self)->strokeBlend = color.a;
116 }
117 if ((*self)->fillOutline || (*self)->strokeOutline) {
118 if ((*self)->flags & piuClip) {
119 PiuRectangleRecord bounds;
120 PiuRectangleSet(&bounds, 0, 0, (*self)->bounds.width, (*self)->bounds.height);
121 PiuViewPushClip(view, 0, 0, bounds.width, bounds.height);
122 PiuViewDrawContent(view, PiuShapeDrawAux, it, 0, 0, bounds.width, bounds.height);
123 PiuViewPopClip(view);
124 }
125 else
126 PiuViewDrawContent(view, PiuShapeDrawAux, it, 0, 0, (*self)->bounds.width, (*self)->bounds.height);
127 }
128 }
129}
130
131void PiuShapeDrawAux(void* it, PiuView* view, PiuCoordinate x, PiuCoordinate y, PiuDimension sw, PiuDimension sh)
132{

Callers

nothing calls this directly

Calls 5

PiuColorsBlendFunction · 0.85
PiuRectangleSetFunction · 0.85
PiuViewPushClipFunction · 0.50
PiuViewDrawContentFunction · 0.50
PiuViewPopClipFunction · 0.50

Tested by

no test coverage detected