Skip to content

Commit

Permalink
Merge pull request #1088 from danielgindi/revert-1087-master
Browse files Browse the repository at this point in the history
Revert "Simple changes to allow OS X 10.10 support"
  • Loading branch information
danielgindi committed May 30, 2016
2 parents d4dbe4c + c8ccaf9 commit f54013e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
6 changes: 2 additions & 4 deletions Charts/Charts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -1505,7 +1504,6 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -1569,7 +1567,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsOSX;
PRODUCT_NAME = Charts;
SDKROOT = macosx;
Expand All @@ -1591,7 +1589,7 @@
INFOPLIST_FILE = "$(SRCROOT)/Supporting Files/Info.plist";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = com.dcg.ChartsOSX;
PRODUCT_NAME = Charts;
SDKROOT = macosx;
Expand Down
4 changes: 2 additions & 2 deletions Charts/Classes/Renderers/ChartXAxisRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public class ChartXAxisRenderer: ChartAxisRendererBase
// avoid clipping of the last
if (i == xAxis.values.count - 1 && xAxis.values.count > 1)
{
let width = labelns.boundingRectWithSize(labelMaxSize, options: .UsesLineFragmentOrigin, attributes: labelAttrs).size.width
let width = labelns.boundingRectWithSize(labelMaxSize, options: .UsesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width

if (width > viewPortHandler.offsetRight * 2.0
&& position.x + width > viewPortHandler.chartWidth)
Expand All @@ -198,7 +198,7 @@ public class ChartXAxisRenderer: ChartAxisRendererBase
}
else if (i == 0)
{ // avoid clipping of the first
let width = labelns.boundingRectWithSize(labelMaxSize, options: .UsesLineFragmentOrigin, attributes: labelAttrs).size.width
let width = labelns.boundingRectWithSize(labelMaxSize, options: .UsesLineFragmentOrigin, attributes: labelAttrs, context: nil).size.width
position.x += width / 2.0
}
}
Expand Down
4 changes: 2 additions & 2 deletions Charts/Classes/Renderers/PieChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public class PieChartRenderer: ChartDataRendererBase
boundingRect = CGRectInset(boundingRect, (boundingRect.width - boundingRect.width * chart.centerTextRadiusPercent) / 2.0, (boundingRect.height - boundingRect.height * chart.centerTextRadiusPercent) / 2.0)
}

let textBounds = centerAttributedText.boundingRectWithSize(boundingRect.size, options: [.UsesLineFragmentOrigin, .UsesFontLeading, .TruncatesLastVisibleLine])
let textBounds = centerAttributedText.boundingRectWithSize(boundingRect.size, options: [.UsesLineFragmentOrigin, .UsesFontLeading, .TruncatesLastVisibleLine], context: nil)

var drawingRect = boundingRect
drawingRect.origin.x += (boundingRect.size.width - textBounds.size.width) / 2.0
Expand All @@ -618,7 +618,7 @@ public class PieChartRenderer: ChartDataRendererBase
CGContextAddPath(context, clippingPath)
CGContextClip(context)

centerAttributedText.drawWithRect(drawingRect, options: [.UsesLineFragmentOrigin, .UsesFontLeading, .TruncatesLastVisibleLine])
centerAttributedText.drawWithRect(drawingRect, options: [.UsesLineFragmentOrigin, .UsesFontLeading, .TruncatesLastVisibleLine], context: nil)

CGContextRestoreGState(context)
}
Expand Down
6 changes: 3 additions & 3 deletions Charts/Classes/Utils/ChartUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public class ChartUtils
CGContextTranslateCTM(context, translate.x, translate.y)
CGContextRotateCTM(context, angleRadians)

(text as NSString).drawWithRect(rect, options: .UsesLineFragmentOrigin, attributes: attributes)
(text as NSString).drawWithRect(rect, options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)

CGContextRestoreGState(context)
}
Expand All @@ -288,15 +288,15 @@ public class ChartUtils
rect.origin.x += point.x
rect.origin.y += point.y

(text as NSString).drawWithRect(rect, options: .UsesLineFragmentOrigin, attributes: attributes)
(text as NSString).drawWithRect(rect, options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)
}

NSUIGraphicsPopContext()
}

internal class func drawMultilineText(context context: CGContext, text: String, point: CGPoint, attributes: [String : AnyObject]?, constrainedToSize: CGSize, anchor: CGPoint, angleRadians: CGFloat)
{
let rect = text.boundingRectWithSize(constrainedToSize, options: .UsesLineFragmentOrigin, attributes: attributes)
let rect = text.boundingRectWithSize(constrainedToSize, options: .UsesLineFragmentOrigin, attributes: attributes, context: nil)
drawMultilineText(context: context, text: text, knownTextSize: rect.size, point: point, attributes: attributes, constrainedToSize: constrainedToSize, anchor: anchor, angleRadians: angleRadians)
}

Expand Down
4 changes: 2 additions & 2 deletions ChartsDemo-OSX/ChartsDemo-OSX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -359,7 +359,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.10;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
Expand Down

0 comments on commit f54013e

Please sign in to comment.