diff options
author | hobbs <hobbs@noemail.net> | 2004-11-17 22:17:10 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2004-11-17 22:17:10 (GMT) |
commit | 9f7091759e45ecf05cbb873f047101b1d9f7c8d4 (patch) | |
tree | 46f09ff41fab1aa9ccb52af2690f24255f698fc2 /generic | |
parent | cebfeb923d35c011e44ab43fe32f55a35dff9981 (diff) | |
download | tk-9f7091759e45ecf05cbb873f047101b1d9f7c8d4.zip tk-9f7091759e45ecf05cbb873f047101b1d9f7c8d4.tar.gz tk-9f7091759e45ecf05cbb873f047101b1d9f7c8d4.tar.bz2 |
* generic/tkCanvImg.c (ImageToPostscript): don't try ps generation
of canvas image item without image specified. [Bug 1032300]
FossilOrigin-Name: 5225d6696d4b541599ed29737d248067f51873f2
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkCanvImg.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c index d0f6122..eed7bb4 100644 --- a/generic/tkCanvImg.c +++ b/generic/tkCanvImg.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvImg.c,v 1.7 2004/01/13 02:06:00 davygrvy Exp $ + * RCS: @(#) $Id: tkCanvImg.c,v 1.8 2004/11/17 22:17:11 hobbs Exp $ */ #include <stdio.h> @@ -741,6 +741,12 @@ ImageToPostscript(interp, canvas, itemPtr, prepass) image = imgPtr->disabledImage; } } + if (image == NULL) { + /* + * Image item without actual image specified. + */ + return TCL_OK; + } Tk_SizeOfImage(image, &width, &height); /* @@ -750,7 +756,7 @@ ImageToPostscript(interp, canvas, itemPtr, prepass) x = imgPtr->x; y = Tk_CanvasPsY(canvas, imgPtr->y); - + switch (imgPtr->anchor) { case TK_ANCHOR_NW: y -= height; break; case TK_ANCHOR_N: x -= width/2.0; y -= height; break; @@ -763,10 +769,6 @@ ImageToPostscript(interp, canvas, itemPtr, prepass) case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break; } - if (image == NULL) { - return TCL_OK; - } - if (!prepass) { sprintf(buffer, "%.15g %.15g", x, y); Tcl_AppendResult(interp, buffer, " translate\n", (char *) NULL); |