And fixed the other issue: didn't fully set uiDrawTextLayoutParams. Oops =P It works! Also did proper memory management before uiUninit()... but it's crashing for other reasons now (using strdup() instead of uiAlloc()). And Skia doesn't map correctly...

This commit is contained in:
Pietro Gagliardi 2018-03-10 22:16:43 -05:00
parent b15f88412b
commit 5ef04f2675
1 changed files with 4 additions and 2 deletions

View File

@ -62,11 +62,12 @@ static void makeAttributedString(void)
static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
{
uiDrawTextLayout *textLayout;
uiFontDescriptor fontdesc;
uiFontDescriptor defaultFont;
uiDrawTextLayoutParams params;
params.String = attrstr;
uiFontButtonFont(fontButton, &fontdesc);
uiFontButtonFont(fontButton, &defaultFont);
params.DefaultFont = &defaultFont;
params.Width = p->AreaWidth - (2 * margins);
params.Align = uiDrawTextAlignLeft;
textLayout = uiDrawNewTextLayout(&params);
@ -153,6 +154,7 @@ int main(void)
uiControlShow(uiControl(mainwin));
uiMain();
uiFreeAttributedString(attrstr);
uiUninit();
return 0;
}