diff options
author | scuri <scuri> | 2009-06-23 20:55:28 +0000 |
---|---|---|
committer | scuri <scuri> | 2009-06-23 20:55:28 +0000 |
commit | f658209d25477c490bf1892e68a0fd1384c1dded (patch) | |
tree | 1d4a2a1088db5ad62acaa3f97f13ccc8906c33b1 /src/drv/cdpicture.c | |
parent | 0610dd4f3064220a2e8fb1d8dc120044eb6c64a8 (diff) |
*** empty log message ***
Diffstat (limited to 'src/drv/cdpicture.c')
-rw-r--r-- | src/drv/cdpicture.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/drv/cdpicture.c b/src/drv/cdpicture.c index 3f5598e..ff4f532 100644 --- a/src/drv/cdpicture.c +++ b/src/drv/cdpicture.c @@ -569,32 +569,32 @@ static void cdfchord(cdCtxCanvas *ctxcanvas, double xc, double yc, double w, dou picUpdateBBox(ctxcanvas, xmax, ymax, 0); } -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) { int xmin, xmax, ymin, ymax; tPrimNode *prim = primCreate(CDPIC_TEXT); primAddAttrib_Text(prim, ctxcanvas->canvas); prim->param.text.x = x; prim->param.text.y = y; - prim->param.text.s = cdStrDup(text); + prim->param.text.s = cdStrDupN(text, len); prim->param_buffer = prim->param.text.s; picAddPrim(ctxcanvas, prim); - cdCanvasGetTextBox(ctxcanvas->canvas, x, y, text, &xmin, &xmax, &ymin, &ymax); + cdCanvasGetTextBox(ctxcanvas->canvas, x, y, prim->param.text.s, &xmin, &xmax, &ymin, &ymax); picUpdateBBox(ctxcanvas, xmin, ymin, 0); picUpdateBBox(ctxcanvas, xmax, ymax, 0); } -static void cdftext(cdCtxCanvas *ctxcanvas, double x, double y, const char *text) +static void cdftext(cdCtxCanvas *ctxcanvas, double x, double y, const char *text, int len) { int xmin, xmax, ymin, ymax; tPrimNode *prim = primCreate(CDPIC_FTEXT); primAddAttrib_Text(prim, ctxcanvas->canvas); prim->param.textf.x = x; prim->param.textf.y = y; - prim->param.textf.s = cdStrDup(text); + prim->param.textf.s = cdStrDupN(text, len); prim->param_buffer = prim->param.textf.s; picAddPrim(ctxcanvas, prim); - cdCanvasGetTextBox(ctxcanvas->canvas, _cdRound(x), _cdRound(y), text, &xmin, &xmax, &ymin, &ymax); + cdCanvasGetTextBox(ctxcanvas->canvas, _cdRound(x), _cdRound(y), prim->param.text.s, &xmin, &xmax, &ymin, &ymax); picUpdateBBox(ctxcanvas, xmin, ymin, 0); picUpdateBBox(ctxcanvas, xmax, ymax, 0); } |