mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 05:30:37 +00:00
NSFont cache font for drawing in flipped views in manner analogous to cache of nonflipped screen font for drawing in regular views
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@21170 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9df5199aa1
commit
159eed5a6c
3 changed files with 30 additions and 8 deletions
|
@ -749,6 +749,7 @@ static void setNSFont(NSString *key, NSFont *font)
|
|||
fontInfo = RETAIN([GSFontInfo fontInfoForFontName: fontName
|
||||
matrix: fontMatrix
|
||||
screenFont: screen]);
|
||||
cachedFlippedFont = placeHolder;
|
||||
if (!screenFont)
|
||||
cachedScreenFont = placeHolder;
|
||||
if (fontInfo == nil)
|
||||
|
@ -789,6 +790,8 @@ static void setNSFont(NSString *key, NSFont *font)
|
|||
RELEASE(fontName);
|
||||
}
|
||||
TEST_RELEASE(fontInfo);
|
||||
if (cachedFlippedFont != placeHolder)
|
||||
DESTROY(cachedFlippedFont);
|
||||
if (cachedScreenFont != placeHolder)
|
||||
DESTROY(cachedScreenFont);
|
||||
[super dealloc];
|
||||
|
@ -849,14 +852,18 @@ static void setNSFont(NSString *key, NSFont *font)
|
|||
|
||||
- (NSFont *)_flippedViewFont
|
||||
{
|
||||
float fontMatrix[6];
|
||||
memcpy(fontMatrix, matrix, sizeof(matrix));
|
||||
fontMatrix[3] *= -1;
|
||||
return AUTORELEASE([placeHolder initWithName: fontName
|
||||
matrix: fontMatrix
|
||||
fix: YES
|
||||
screenFont: screenFont
|
||||
role: role]);
|
||||
if (cachedFlippedFont == placeHolder)
|
||||
{
|
||||
float fontMatrix[6];
|
||||
memcpy(fontMatrix, matrix, sizeof(matrix));
|
||||
fontMatrix[3] *= -1;
|
||||
cachedFlippedFont = [placeHolder initWithName: fontName
|
||||
matrix: fontMatrix
|
||||
fix: YES
|
||||
screenFont: screenFont
|
||||
role: role];
|
||||
}
|
||||
return AUTORELEASE(RETAIN(cachedFlippedFont));
|
||||
}
|
||||
|
||||
static BOOL flip_hack;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue