summaryrefslogtreecommitdiff
path: root/src/xrender/cdxrender.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-06-23 20:55:28 +0000
committerscuri <scuri>2009-06-23 20:55:28 +0000
commitf658209d25477c490bf1892e68a0fd1384c1dded (patch)
tree1d4a2a1088db5ad62acaa3f97f13ccc8906c33b1 /src/xrender/cdxrender.c
parent0610dd4f3064220a2e8fb1d8dc120044eb6c64a8 (diff)
*** empty log message ***
Diffstat (limited to 'src/xrender/cdxrender.c')
-rw-r--r--src/xrender/cdxrender.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/xrender/cdxrender.c b/src/xrender/cdxrender.c
index 98f65aa..4dc69e2 100644
--- a/src/xrender/cdxrender.c
+++ b/src/xrender/cdxrender.c
@@ -716,31 +716,29 @@ static void cdgetfontdim(cdCtxCanvas *ctxcanvas, int *max_width, int *height, in
if (descent) *descent = ctxcanvas->ctxplus->font->descent;
}
-static void cdgettextsize(cdCtxCanvas *ctxcanvas, const char *text, int *width, int *height)
+static void cdgettextsize(cdCtxCanvas *ctxcanvas, const char *text, int len, int *width, int *height)
{
XGlyphInfo extents;
if (!ctxcanvas->ctxplus->font)
return;
if (ctxcanvas->canvas->text_orientation)
- XftTextExtents8(ctxcanvas->dpy, ctxcanvas->ctxplus->flat_font, (XftChar8*)text, strlen(text), &extents);
+ XftTextExtents8(ctxcanvas->dpy, ctxcanvas->ctxplus->flat_font, (XftChar8*)text, len, &extents);
else
- XftTextExtents8(ctxcanvas->dpy, ctxcanvas->ctxplus->font, (XftChar8*)text, strlen(text), &extents);
+ XftTextExtents8(ctxcanvas->dpy, ctxcanvas->ctxplus->font, (XftChar8*)text, len, &extents);
if (width) *width = extents.width+extents.x;
if (height) *height = extents.height+extents.y;
}
-static void cdtext(cdCtxCanvas *ctxcanvas, int x, int y, const char *text)
+static void cdtext(cdCtxCanvas *ctxcanvas, int x, int y, const char *text, int len)
{
XGlyphInfo extents;
- int ox, oy, w, h, len, descent, dir = -1;
+ int ox, oy, w, h, descent, dir = -1;
if (!ctxcanvas->ctxplus->font)
return;
- len = strlen(text);
-
if (ctxcanvas->canvas->text_orientation)
XftTextExtents8(ctxcanvas->dpy, ctxcanvas->ctxplus->flat_font, (XftChar8*)text, len, &extents);
else