diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-25 08:46:19 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-25 08:46:19 (GMT) |
commit | 3a645026ccc01230eb7fdc881f29449f079dba24 (patch) | |
tree | 300bdbf751fffaf45a10beb928d52a81f86718d0 | |
parent | 6e6938ae4bc0b377bf297dd32a1b2a7a72c4075d (diff) | |
download | tk-3a645026ccc01230eb7fdc881f29449f079dba24.zip tk-3a645026ccc01230eb7fdc881f29449f079dba24.tar.gz tk-3a645026ccc01230eb7fdc881f29449f079dba24.tar.bz2 |
Fix [Bug 979239] by only redrawing an image when it has real area.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 11 |
2 files changed, 16 insertions, 1 deletions
@@ -1,3 +1,9 @@ +2004-06-25 Donal K. Fellows <donal.k.fellows@man.ac.uk> + + * generic/tkImgPhoto.c (ImgPhotoDisplay): Early exit from image + redraw if the region to redraw is empty, so stopping XGetImage + from bailing out. [Bug 979239] + 2004-06-08 Mo DeJong <mdejong@users.sourceforge.net> * generic/tkCanvText.c (DisplayCanvText): Fix text diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 6702946..83a7f8b 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.8 2004/05/03 18:01:32 hobbs Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.9 2004/06/25 08:46:20 dkf Exp $ */ #include "tkInt.h" @@ -2719,6 +2719,15 @@ ImgPhotoDisplay(clientData, display, drawable, imageX, imageY, width, return; } + /* + * Check for bogus widths/heights. This prevents us from calling + * XGetImage with a zero size, which it does not like. [Bug 979239] + */ + + if (width < 1 || height < 1) { + return; + } + if ( #if defined(MAC_TCL) /* |