MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / TextGroupWidget_SetFont

Function TextGroupWidget_SetFont

src/Widgets.c:2450–2463  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2448
2449
2450void TextGroupWidget_SetFont(struct TextGroupWidget* w, struct FontDesc* font) {
2451 int i, height;
2452
2453 height = Font_CalcHeight(font, true);
2454 Drawer2D_ReducePadding_Height(&height, font->size, 3);
2455 w->defaultHeight = height;
2456
2457 for (i = 0; i < w->lines; i++)
2458 {
2459 w->textures[i].height = w->collapsible[i] ? 0 : height;
2460 }
2461 w->font = font;
2462 Widget_Layout(w);
2463}
2464
2465static void TextGroupWidget_Render(void* widget) {
2466 struct TextGroupWidget* w = (struct TextGroupWidget*)widget;

Calls 2

Font_CalcHeightFunction · 0.85

Tested by

no test coverage detected