diff options
author | culler <culler> | 2020-08-25 11:36:19 (GMT) |
---|---|---|
committer | culler <culler> | 2020-08-25 11:36:19 (GMT) |
commit | 797d843a17df7fab1e27d6b10629d323b2987919 (patch) | |
tree | 399538284c47e6b52560b4c44fbe259926b9a0bc | |
parent | 08b64027f4480a5aaa634ba89da1704539893bc5 (diff) | |
download | tk-797d843a17df7fab1e27d6b10629d323b2987919.zip tk-797d843a17df7fab1e27d6b10629d323b2987919.tar.gz tk-797d843a17df7fab1e27d6b10629d323b2987919.tar.bz2 |
Fix one more compilation issue with old macOS targets.
-rw-r--r-- | macosx/tkMacOSXBitmap.c | 4 | ||||
-rw-r--r-- | macosx/tkMacOSXConstants.h | 10 | ||||
-rw-r--r-- | macosx/tkMacOSXFont.c | 3 |
3 files changed, 10 insertions, 7 deletions
diff --git a/macosx/tkMacOSXBitmap.c b/macosx/tkMacOSXBitmap.c index 213d925..402178a 100644 --- a/macosx/tkMacOSXBitmap.c +++ b/macosx/tkMacOSXBitmap.c @@ -142,9 +142,7 @@ PixmapFromImage( .tx = 0, .ty = size.height}; CGContextConcatCTM(dc.context, t); [NSGraphicsContext saveGraphicsState]; - [NSGraphicsContext setCurrentContext:[NSGraphicsContext - graphicsContextWithGraphicsPort:dc.context - flipped:NO]]; + [NSGraphicsContext setCurrentContext:TkMacOSXNSContext(dc.context)]; [image drawAtPoint:NSZeroPoint fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; [NSGraphicsContext restoreGraphicsState]; diff --git a/macosx/tkMacOSXConstants.h b/macosx/tkMacOSXConstants.h index 19ffd2c..4fc9fd6 100644 --- a/macosx/tkMacOSXConstants.h +++ b/macosx/tkMacOSXConstants.h @@ -102,12 +102,18 @@ typedef NSInteger NSModalResponse; #define NSStringPboardType NSPasteboardTypeString #define NSOnState NSControlStateValueOn #define NSOffState NSControlStateValueOff -// Now we are also changing names of methods! -#define graphicsContextWithGraphicsPort graphicsContextWithCGContext #endif #if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 #define NSWindowStyleMaskTexturedBackground 0 #endif +#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000 +#define TkMacOSXNSContext(context) [NSGraphicsContext \ + graphicsContextWithGraphicsPort:context flipped:NO] +#else +#define TkMacOSXNSContext(context) [NSGraphicsContext \ + graphicsContextWithCGContext:context flipped:NO] +#endif + #endif diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c index f58e831..b535ffe 100644 --- a/macosx/tkMacOSXFont.c +++ b/macosx/tkMacOSXFont.c @@ -1212,8 +1212,7 @@ TkpDrawAngledCharsInContext( [attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName]; CFRelease(fg); nsFont = [attributes objectForKey:NSFontAttributeName]; - [nsFont setInContext:[NSGraphicsContext graphicsContextWithGraphicsPort: - context flipped:NO]]; + [nsFont setInContext:TkMacOSXNSContext(context)]; CGContextSetTextMatrix(context, CGAffineTransformIdentity); attributedString = [[NSAttributedString alloc] initWithString:string attributes:attributes]; |