mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-25 14:33:42 +00:00
* NSView.m resizeSubviewsWithOldSize: check whether view has ever been
rotated (per 4.2 docs). * NSStringDrawing.m sizeWithAttributes: fix minor bug introduced while optimizing tab calc. * NSCell.m: drawInteriorWithFrame: minor optimization git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@3379 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
99e67e6618
commit
b57813676d
6 changed files with 33 additions and 19 deletions
|
@ -41,6 +41,7 @@ NSFont *font;
|
|||
const char *str = [self cString];
|
||||
int i = 0, j = TABWIDTH;
|
||||
static float tabSize;
|
||||
float tabSumSize;
|
||||
static float pointSize;
|
||||
static NSFont *lastFont = nil;
|
||||
|
||||
|
@ -60,12 +61,14 @@ static NSFont *lastFont = nil;
|
|||
|
||||
if(font != lastFont) // update font info
|
||||
{ // if font changes
|
||||
tabSize = (float)i * [font widthOfString:@"\t"];
|
||||
tabSize = [font widthOfString:@"\t"];
|
||||
lastFont = font;
|
||||
pointSize = [font pointSize];
|
||||
}
|
||||
|
||||
tabSumSize = (float)i * tabSize;
|
||||
|
||||
return NSMakeSize(([font widthOfString:self] + tabSize), pointSize);
|
||||
return NSMakeSize(([font widthOfString:self] + tabSumSize), pointSize);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue