* Source/NSImage.m: Throw an exception if you attempt to lock focus on an image with

size (0, 0)
* Source/NSCachedImageRep.m: Throw an exception if you attempt to create a cached
image rep with a size of (0, 0).


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33819 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-09-08 18:42:31 +00:00
parent 741578fb42
commit 192e2d6174
3 changed files with 19 additions and 0 deletions

View file

@ -1055,6 +1055,10 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
NSWindow *window;
GSRepData *repd;
if (NSSizesEqual(NSZeroSize, [self size]))
[NSException raise: NSImageCacheException
format: @"Cannot lock focus on image with size (0, 0)"];
if (imageRep == nil)
imageRep = [self bestRepresentationForDevice: nil];