Skip to content

Commit

Permalink
Merge pull request vurtun#777 from sa-kib/rawfb_xft_demo_fixes
Browse files Browse the repository at this point in the history
x11_rawfb and x11_xft demos fixes
  • Loading branch information
dumblob authored May 28, 2019
2 parents 509c75b + 945c7f8 commit b76f2f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions demo/x11_rawfb/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,13 +228,13 @@ main(void)

/* -------------- EXAMPLES ---------------- */
#ifdef INCLUDE_CALCULATOR
calculator(ctx);
calculator(&rawfb->ctx);
#endif
#ifdef INCLUDE_OVERVIEW
overview(ctx);
overview(&rawfb->ctx);
#endif
#ifdef INCLUDE_NODE_EDITOR
node_editor(ctx);
node_editor(&rawfb->ctx);
#endif
/* ----------------------------------------- */

Expand Down
4 changes: 2 additions & 2 deletions demo/x11_xft/nuklear_xlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ nk_xsurf_draw_text(XSurface *surf, short x, short y, unsigned short w, unsigned
xrc.blue = cfg.b * 257;
xrc.alpha = cfg.a * 257;
XftColorAllocValue(surf->dpy, xlib.vis, xlib.cmap, &xrc, &color);
XftDrawString8(surf->ftdraw, &color, font->ft, tx, ty, (FcChar8*)text, len);
XftDrawStringUtf8(surf->ftdraw, &color, font->ft, tx, ty, (FcChar8*)text, len);
}
#else
XSetForeground(surf->dpy, surf->gc, fg);
Expand Down Expand Up @@ -632,7 +632,7 @@ nk_xfont_get_text_width(nk_handle handle, float height, const char *text, int le
XGlyphInfo g;
if(!font || !text)
return 0;
XftTextExtents8(xlib.dpy, font->ft, (FcChar8*)text, len, &g);
XftTextExtentsUtf8(xlib.dpy, font->ft, (FcChar8*)text, len, &g);
return g.width;
#else
XRectangle r;
Expand Down

0 comments on commit b76f2f2

Please sign in to comment.