Removed the margins from the drawtext example. It looks better this way.

This commit is contained in:
Pietro Gagliardi 2018-03-18 15:39:44 -04:00
parent a0d2d6a1f8
commit d788d86239
1 changed files with 2 additions and 5 deletions

View File

@ -11,8 +11,6 @@ uiCombobox *alignment;
uiAttributedString *attrstr;
#define margins 20
static void appendWithAttribute(const char *what, uiAttribute *attr, uiAttribute *attr2)
{
size_t start, end;
@ -103,11 +101,10 @@ static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
params.String = attrstr;
uiFontButtonFont(fontButton, &defaultFont);
params.DefaultFont = &defaultFont;
params.Width = p->AreaWidth - (2 * margins);
params.Width = p->AreaWidth;
params.Align = (uiDrawTextAlign) uiComboboxSelected(alignment);
textLayout = uiDrawNewTextLayout(&params);
// TODO clip to margins
uiDrawText(p->Context, textLayout, margins, margins);
uiDrawText(p->Context, textLayout, 0, 0);
uiDrawFreeTextLayout(textLayout);
uiFreeFontButtonFont(&defaultFont);
}