Use NSString interface to determine size of string to be drawn

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6281 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2000-03-15 02:40:43 +00:00
parent 35c5942b70
commit 8fc09a3db5

View file

@ -48,9 +48,6 @@
#include <AppKit/NSGraphics.h>
#include <AppKit/PSOperators.h>
#include "GSUtil.h"
@implementation NSButtonCell
/*
@ -494,8 +491,11 @@
if (titleToDisplay && (ipos == NSImageAbove || ipos == NSImageBelow))
{
titleSize
= GSUtil_sizeOfMultilineStringWithFont(titleToDisplay, _cell_font);
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
_cell_font,
NSFontAttributeName,
nil];
titleSize = [titleToDisplay sizeWithAttributes: dict];
}
if (flippedView == YES)
@ -697,8 +697,12 @@
if (titleToDisplay != nil)
{
titleSize
= GSUtil_sizeOfMultilineStringWithFont(titleToDisplay, _cell_font);
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
_cell_font,
NSFontAttributeName,
nil];
titleSize = [titleToDisplay sizeWithAttributes: dict];
}
else
{