And fixed errors. Woo, it works!!!!!
This commit is contained in:
parent
907d7c5830
commit
7f270942a7
|
@ -131,6 +131,8 @@ void uiAttributedStringInsertAtUnattributed(uiAttributedString *s, const char *s
|
|||
// TODO
|
||||
}
|
||||
|
||||
at16 = 0;
|
||||
if (s->u8tou16 != NULL)
|
||||
at16 = s->u8tou16[at];
|
||||
|
||||
// do this first to reclaim memory
|
||||
|
|
|
@ -231,7 +231,8 @@ void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y)
|
|||
CGContextSetTextMatrix(c->c, CGAffineTransformIdentity);
|
||||
|
||||
// wait, that's not enough; we need to offset y values to account for our new flipping
|
||||
y = c->height - y;
|
||||
// TODO explain this calculation
|
||||
y = c->height - tl->size.height - y;
|
||||
|
||||
// CTFrameDraw() draws in the path we specified when creating the frame
|
||||
// this means that in our usage, CTFrameDraw() will draw at (0,0)
|
||||
|
|
|
@ -34,7 +34,7 @@ uiDrawFontDescriptor defaultFont = {
|
|||
};
|
||||
uiAttributedString *attrstr;
|
||||
|
||||
#define margins 5
|
||||
#define margins 10
|
||||
|
||||
static void handlerDraw(uiAreaHandler *a, uiArea *area, uiAreaDrawParams *p)
|
||||
{
|
||||
|
@ -113,8 +113,7 @@ int main(void)
|
|||
|
||||
attrstr = uiNewAttributedString(text);
|
||||
|
||||
mainwin = uiNewWindow("libui Histogram Example", 640, 480, 1);
|
||||
uiWindowSetMargined(mainwin, 1);
|
||||
mainwin = uiNewWindow("libui Text-Drawing Example", 640, 480, 1);
|
||||
uiWindowOnClosing(mainwin, onClosing, NULL);
|
||||
|
||||
area = uiNewArea(&handler);
|
||||
|
|
Loading…
Reference in New Issue