mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 02:30:37 +00:00
* Source/GSFontInfo.m (-defaultLineHeightForFont): Adjust line
height calculation. * Source/NSButtonCell.m (-drawInteriorWithFrame:inView:): Always initialize imageRect and titleRect. Adjust the calculations to match the new line height. (-cellSize): Always initialize imageRect and titleRect. * Headers/AppKit/NSCell.h (-_drawImage:inFrame:isFlipped:): Remove. * Source/NSCell.m (-_drawImage:inFrame:isFlipped:): Remove. Move code back ... (-drawInteriorWithFrame:inView:): ... here. * Source/NSToolbarItem.m (+initialize): Remove. (+cellClass): Add. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20100 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e2e0084fdb
commit
811ae4cf9f
6 changed files with 69 additions and 50 deletions
|
@ -425,15 +425,17 @@ static GSFontEnumerator *sharedEnumerator = nil;
|
|||
- (float) defaultLineHeightForFont
|
||||
{
|
||||
/*
|
||||
Generally, roman text is centered in the line disregarding the descender,
|
||||
and the descender height is added above and below. Thus, the line height
|
||||
should be ascender_height+2*descender_height. (Note that descender is
|
||||
negative below the baseline.)
|
||||
In the absence of a more accurate line height from the font itself, we
|
||||
use ascender_height+descender_height (note that descender is negative
|
||||
below the baseline). This matches what other systems do, and it matches
|
||||
the font-provided line height in most cases. (Note that the ascender
|
||||
height usually includes a bit of space above the top of the actual
|
||||
glyphs, so we get some inter-line spacing anyway.)
|
||||
|
||||
This calculation should match the baseline calculation in
|
||||
GSHorizontalTypesetter, or text will look odd.
|
||||
*/
|
||||
return [self ascender] - 2 * [self descender];
|
||||
return [self ascender] - [self descender];
|
||||
}
|
||||
|
||||
- (NSSize) advancementForGlyph: (NSGlyph)aGlyph
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue