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)
|
static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
|
||||||
{
|
{
|
||||||
uiDrawTextLayout *textLayout;
|
uiDrawTextLayout *textLayout;
|
||||||
uiFontDescriptor fontdesc;
|
uiFontDescriptor defaultFont;
|
||||||
uiDrawTextLayoutParams params;
|
uiDrawTextLayoutParams params;
|
||||||
|
|
||||||
params.String = attrstr;
|
params.String = attrstr;
|
||||||
uiFontButtonFont(fontButton, &fontdesc);
|
uiFontButtonFont(fontButton, &defaultFont);
|
||||||
|
params.DefaultFont = &defaultFont;
|
||||||
params.Width = p->AreaWidth - (2 * margins);
|
params.Width = p->AreaWidth - (2 * margins);
|
||||||
params.Align = uiDrawTextAlignLeft;
|
params.Align = uiDrawTextAlignLeft;
|
||||||
textLayout = uiDrawNewTextLayout(¶ms);
|
textLayout = uiDrawNewTextLayout(¶ms);
|
||||||
|
@ -153,6 +154,7 @@ int main(void)
|
||||||
|
|
||||||
uiControlShow(uiControl(mainwin));
|
uiControlShow(uiControl(mainwin));
|
||||||
uiMain();
|
uiMain();
|
||||||
|
uiFreeAttributedString(attrstr);
|
||||||
uiUninit();
|
uiUninit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue