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

Function PiuCodeComputeStyle

modules/piu/PC/Code/piuCode.c:154–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void PiuCodeComputeStyle(PiuCode* self)
155{
156 xsMachine* the = (*self)->the;
157 PiuApplication* application = (*self)->application;
158 PiuContainer* container = (PiuContainer*)self;
159 PiuStyleLink* list = (*application)->styleList;
160 PiuStyleLink* chain = NULL;
161 while (container) {
162 PiuStyle* style = (*container)->style;
163 if (style) {
164 list = PiuStyleLinkMatch(the, list, chain, style);
165 chain = list;
166 }
167 container = (*container)->container;
168 }
169 if (chain) {
170 PiuStyle* result = PiuStyleLinkCompute(the, chain, application);
171 (*self)->computedStyle = result;
172 xsResult = xsString("w");
173 (*self)->columnWidth = PiuFontGetWidthSubPixel((*result)->font, &xsResult, 0, 1);
174 (*self)->lineHeight = PiuFontGetHeight((*result)->font);
175 }
176}
177
178void PiuCodeDictionary(xsMachine* the, void* it)
179{

Callers 2

PiuCodeBindFunction · 0.85
PiuCodeCascadeFunction · 0.85

Calls 4

PiuStyleLinkMatchFunction · 0.85
PiuStyleLinkComputeFunction · 0.85
PiuFontGetWidthSubPixelFunction · 0.50
PiuFontGetHeightFunction · 0.50

Tested by

no test coverage detected