Set size to zero if image does not exist

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11200 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2001-10-18 02:21:33 +00:00
parent 1962cf341f
commit a9d48edd44
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2001-10-17 Adam Fedor <fedor@gnu.org>
* Source/NSMenuItemCell.m (calcSize): Set size to 0 if image does
not exist.
Wed Oct 17 04:30:25 2001 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSTabView.m ([NSTabView -dealloc]): Do not release the

View file

@ -131,6 +131,8 @@ static NSImage *arrowImageH = nil;
// NSOnState
if ([_menuItem onStateImage])
componentSize = [[_menuItem onStateImage] size];
else
componentSize = NSMakeSize(0,0);
_stateImageWidth = componentSize.width;
if (componentSize.height > neededMenuItemHeight)
neededMenuItemHeight = componentSize.height;
@ -138,6 +140,8 @@ static NSImage *arrowImageH = nil;
// NSOffState
if ([_menuItem offStateImage])
componentSize = [[_menuItem offStateImage] size];
else
componentSize = NSMakeSize(0,0);
if (componentSize.width > _stateImageWidth)
_stateImageWidth = componentSize.width;
if (componentSize.height > neededMenuItemHeight)
@ -146,6 +150,8 @@ static NSImage *arrowImageH = nil;
// NSMixedState
if ([_menuItem mixedStateImage])
componentSize = [[_menuItem mixedStateImage] size];
else
componentSize = NSMakeSize(0,0);
if (componentSize.width > _stateImageWidth)
_stateImageWidth = componentSize.width;
if (componentSize.height > neededMenuItemHeight)