mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 22:00:38 +00:00
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:
parent
6abceeca91
commit
761ada3e09
2 changed files with 11 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue