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:
fedor 2001-10-18 02:21:33 +00:00
parent 6abceeca91
commit 761ada3e09
2 changed files with 11 additions and 0 deletions

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)