diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 8c8797af4b9f..b391fba636ae 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -807,7 +807,12 @@ void drawRect (NSRect r) if (r.size.width < 1.0f || r.size.height < 1.0f) return; - auto cg = (CGContextRef) [[NSGraphicsContext currentContext] CGContext]; + auto cg = (CGContextRef) [[NSGraphicsContext currentContext] + #if (defined (MAC_OS_X_VERSION_10_10) && MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10) + CGContext]; + #else + graphicsPort]; + #endif if (! component.isOpaque()) CGContextClearRect (cg, CGContextGetClipBoundingBox (cg));