mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +00:00
* 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:
parent
11dfb73516
commit
ae291881d9
3 changed files with 19 additions and 0 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2011-09-08 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* 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).
|
||||||
|
|
||||||
2011-09-07 Eric Wasylishen <ewasylishen@gmail.com>
|
2011-09-07 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/NSFontPanel.m: Add a tooltip on the character panel button
|
* Source/NSFontPanel.m: Add a tooltip on the character panel button
|
||||||
|
|
|
@ -89,6 +89,14 @@
|
||||||
{
|
{
|
||||||
NSWindow *win;
|
NSWindow *win;
|
||||||
|
|
||||||
|
if (aSize.width <= 0 || aSize.height <= 0 ||
|
||||||
|
pixelsWide <= 0 || pixelsHigh <= 0)
|
||||||
|
{
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"NSCachedImageRep created with size %@ pixelsWide %d pixelsHigh %d",
|
||||||
|
NSStringFromSize(aSize), pixelsWide, pixelsHigh];
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: Only create new window when separate is YES
|
// FIXME: Only create new window when separate is YES
|
||||||
win = [[GSCacheW alloc] initWithContentRect: NSMakeRect(0, 0, pixelsWide, pixelsHigh)
|
win = [[GSCacheW alloc] initWithContentRect: NSMakeRect(0, 0, pixelsWide, pixelsHigh)
|
||||||
styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask
|
styleMask: NSBorderlessWindowMask | NSUnscaledWindowMask
|
||||||
|
|
|
@ -1055,6 +1055,10 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
||||||
NSWindow *window;
|
NSWindow *window;
|
||||||
GSRepData *repd;
|
GSRepData *repd;
|
||||||
|
|
||||||
|
if (NSSizesEqual(NSZeroSize, [self size]))
|
||||||
|
[NSException raise: NSImageCacheException
|
||||||
|
format: @"Cannot lock focus on image with size (0, 0)"];
|
||||||
|
|
||||||
if (imageRep == nil)
|
if (imageRep == nil)
|
||||||
imageRep = [self bestRepresentationForDevice: nil];
|
imageRep = [self bestRepresentationForDevice: nil];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue