summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-11-17 22:18:50 (GMT)
committerhobbs <hobbs>2004-11-17 22:18:50 (GMT)
commit2879038c4eb48b14f20eb0053c9f4d7f2c82c5ed (patch)
treedfa46a78bcd3f9f879765f357eed991bcd53c13b
parentbd3a97c98ef8a1061e13b1a31779f90fbc013f8c (diff)
downloadtk-2879038c4eb48b14f20eb0053c9f4d7f2c82c5ed.zip
tk-2879038c4eb48b14f20eb0053c9f4d7f2c82c5ed.tar.gz
tk-2879038c4eb48b14f20eb0053c9f4d7f2c82c5ed.tar.bz2
* generic/tkCanvImg.c (ImageToPostscript): don't try ps generation
of canvas image item without image specified. [Bug 1032300]
-rw-r--r--generic/tkCanvImg.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/tkCanvImg.c b/generic/tkCanvImg.c
index 5aa036b..a37de89 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.6 2003/02/09 07:48:22 hobbs Exp $
+ * RCS: @(#) $Id: tkCanvImg.c,v 1.6.2.1 2004/11/17 22:18:50 hobbs Exp $
*/
#include <stdio.h>
@@ -727,7 +727,7 @@ ImageToPostscript(interp, canvas, itemPtr, prepass)
Tk_Image image;
Tk_State state = itemPtr->state;
- if(state == TK_STATE_NULL) {
+ if (state == TK_STATE_NULL) {
state = ((TkCanvas *)canvas)->canvas_state;
}
@@ -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);