From b98cccfe8bbd8a0596e88ce895bd7daa90fb3d69 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 27 Mar 2014 18:24:47 +1100 Subject: Surround 10.9-specific calls with version checks to ensure builds on old SDKs. --- cocoa/ScintillaCocoa.mm | 4 ++++ cocoa/ScintillaView.mm | 2 ++ 2 files changed, 6 insertions(+) (limited to 'cocoa') diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index c5f24fcd6..cf517db2d 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -717,6 +717,7 @@ PRectangle ScintillaCocoa::GetClientRectangle() * Allow for prepared rectangle */ PRectangle ScintillaCocoa::GetClientDrawingRectangle() { +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 SCIContentView *content = ContentView(); if ([content respondsToSelector: @selector(setPreparedContentRect:)]) { NSRect rcPrepared = [content preparedContentRect]; @@ -724,6 +725,7 @@ PRectangle ScintillaCocoa::GetClientDrawingRectangle() { return PRectangle(rcPrepared.origin.x, rcPrepared.origin.y, rcPrepared.origin.x+rcPrepared.size.width, rcPrepared.origin.y + rcPrepared.size.height); } +#endif return ScintillaCocoa::GetClientRectangle(); } @@ -757,11 +759,13 @@ void ScintillaCocoa::RedrawRect(PRectangle rc) void ScintillaCocoa::DiscardOverdraw() { +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 // If running on 10.9, reset prepared area to visible area SCIContentView *content = ContentView(); if ([content respondsToSelector: @selector(setPreparedContentRect:)]) { content.preparedContentRect = [content visibleRect]; } +#endif } //-------------------------------------------------------------------------------------------------- diff --git a/cocoa/ScintillaView.mm b/cocoa/ScintillaView.mm index 222fcdc8f..bd79fbb71 100644 --- a/cocoa/ScintillaView.mm +++ b/cocoa/ScintillaView.mm @@ -253,7 +253,9 @@ static NSCursor *cursorFromEnum(Window::Cursor cursor) - (void) prepareContentInRect: (NSRect) rect { mOwner.backend->WillDraw(rect); +#if MAC_OS_X_VERSION_MAX_ALLOWED > 1080 [super prepareContentInRect: rect]; +#endif } //-------------------------------------------------------------------------------------------------- -- cgit v1.2.3