From 8bab61bdd69793c1576792b6ff2b609857d9efcc Mon Sep 17 00:00:00 2001 From: Daniel Clelland Date: Sat, 15 Sep 2018 21:15:48 +0700 Subject: [PATCH 1/2] Use `abs` instead of the deprecated function `fabs` --- Source/Charts/Charts/BarLineChartViewBase.swift | 4 ++-- Source/Charts/Filters/DataApproximator+N.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Charts/Charts/BarLineChartViewBase.swift b/Source/Charts/Charts/BarLineChartViewBase.swift index 052affae2c..f3c90279c9 100644 --- a/Source/Charts/Charts/BarLineChartViewBase.swift +++ b/Source/Charts/Charts/BarLineChartViewBase.swift @@ -877,8 +877,8 @@ open class BarLineChartViewBase: ChartViewBase, BarLineScatterCandleBubbleChartD let velocity = _panGestureRecognizer.velocity(in: self) if _data === nil || !isDragEnabled || (self.hasNoDragOffset && self.isFullyZoomedOut && !self.isHighlightPerDragEnabled) || - (!_dragYEnabled && fabs(velocity.y) > fabs(velocity.x)) || - (!_dragXEnabled && fabs(velocity.y) < fabs(velocity.x)) + (!_dragYEnabled && abs(velocity.y) > abs(velocity.x)) || + (!_dragXEnabled && abs(velocity.y) < abs(velocity.x)) { return false } diff --git a/Source/Charts/Filters/DataApproximator+N.swift b/Source/Charts/Filters/DataApproximator+N.swift index 32a7784664..36bbeec424 100644 --- a/Source/Charts/Filters/DataApproximator+N.swift +++ b/Source/Charts/Filters/DataApproximator+N.swift @@ -15,7 +15,7 @@ extension CGPoint { let dx = linePoint2.x - linePoint1.x let dy = linePoint2.y - linePoint1.y - let dividend = fabs(dy * self.x - dx * self.y - linePoint1.x * linePoint2.y + linePoint2.x * linePoint1.y) + let dividend = abs(dy * self.x - dx * self.y - linePoint1.x * linePoint2.y + linePoint2.x * linePoint1.y) let divisor = sqrt(dx * dx + dy * dy) return dividend / divisor From c510e7496d5cae3136d27ceef22a68edef5b0440 Mon Sep 17 00:00:00 2001 From: Daniel Clelland Date: Sat, 15 Sep 2018 21:16:49 +0700 Subject: [PATCH 2/2] Fix warning where `let` properties are implicitly `final` and should just be marked `public` instead --- Source/Charts/Renderers/ChartDataRendererBase.swift | 2 +- Source/Charts/Renderers/Renderer.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Charts/Renderers/ChartDataRendererBase.swift b/Source/Charts/Renderers/ChartDataRendererBase.swift index 024516aa15..1a95b7b3b6 100644 --- a/Source/Charts/Renderers/ChartDataRendererBase.swift +++ b/Source/Charts/Renderers/ChartDataRendererBase.swift @@ -15,7 +15,7 @@ import CoreGraphics @objc(ChartDataRendererBase) open class DataRenderer: Renderer { - @objc open let animator: Animator + @objc public let animator: Animator @objc public init(animator: Animator, viewPortHandler: ViewPortHandler) { diff --git a/Source/Charts/Renderers/Renderer.swift b/Source/Charts/Renderers/Renderer.swift index 5c929f28e0..e57a9b853f 100644 --- a/Source/Charts/Renderers/Renderer.swift +++ b/Source/Charts/Renderers/Renderer.swift @@ -16,7 +16,7 @@ import CoreGraphics open class Renderer: NSObject { /// the component that handles the drawing area of the chart and it's offsets - @objc open let viewPortHandler: ViewPortHandler + @objc public let viewPortHandler: ViewPortHandler @objc public init(viewPortHandler: ViewPortHandler) {