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:
parent
b15f88412b
commit
5ef04f2675
|
@ -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(¶ms);
|
||||
|
@ -153,6 +154,7 @@ int main(void)
|
|||
|
||||
uiControlShow(uiControl(mainwin));
|
||||
uiMain();
|
||||
uiFreeAttributedString(attrstr);
|
||||
uiUninit();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue