diff options
author | hobbs <hobbs@noemail.net> | 2003-05-11 00:52:40 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2003-05-11 00:52:40 (GMT) |
commit | b8763f99dc5417a7d733bb6cb9ca139b8704bece (patch) | |
tree | d7b1b2f0d22d1a6effe4300b261b62b8f03ccfe9 /generic/tkCanvPoly.c | |
parent | 70d0bc1475318f208f5e4537bf727f2f1c4b33ba (diff) | |
download | tk-b8763f99dc5417a7d733bb6cb9ca139b8704bece.zip tk-b8763f99dc5417a7d733bb6cb9ca139b8704bece.tar.gz tk-b8763f99dc5417a7d733bb6cb9ca139b8704bece.tar.bz2 |
* generic/tkCanvPoly.c (PolygonToPostscript):
* tests/canvPs.test: correct crash when generating postscript for
a single-line polygon (point) with no color. [Bug #734498] (wilm)
FossilOrigin-Name: da0424bd6c23fd9034cd30cbfed4dd5d8cf1990b
Diffstat (limited to 'generic/tkCanvPoly.c')
-rw-r--r-- | generic/tkCanvPoly.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c index 5058b9f..124c8d1 100644 --- a/generic/tkCanvPoly.c +++ b/generic/tkCanvPoly.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvPoly.c,v 1.10 2003/02/09 07:48:22 hobbs Exp $ + * RCS: @(#) $Id: tkCanvPoly.c,v 1.11 2003/05/11 00:52:41 hobbs Exp $ */ #include <stdio.h> @@ -1852,13 +1852,16 @@ PolygonToPostscript(interp, canvas, itemPtr, prepass) } if (polyPtr->numPoints==2) { char string[128]; + if (color == NULL) { + return TCL_OK; + } + sprintf(string, "%.15g %.15g translate %.15g %.15g", polyPtr->coordPtr[0], Tk_CanvasPsY(canvas, polyPtr->coordPtr[1]), width/2.0, width/2.0); Tcl_AppendResult(interp, "matrix currentmatrix\n",string, " scale 1 0 moveto 0 0 1 0 360 arc\nsetmatrix\n", (char *) NULL); - if (Tk_CanvasPsColor(interp, canvas, color) - != TCL_OK) { + if (Tk_CanvasPsColor(interp, canvas, color) != TCL_OK) { return TCL_ERROR; } if (stipple != None) { |