diff --git a/M13Checkbox.podspec b/M13Checkbox.podspec index e700a86..e8bda10 100644 --- a/M13Checkbox.podspec +++ b/M13Checkbox.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "M13Checkbox" - s.version = "2.2.5" + s.version = "2.2.6" s.summary = "A beautiful, customizable, extendable, animated checkbox for iOS." s.description = <<-DESC @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.platform = :ios, '8.0' - s.source = { :git => "https://github.com/Marxon13/M13Checkbox.git", :tag => "2.2.5"} + s.source = { :git => "https://github.com/Marxon13/M13Checkbox.git", :tag => "2.2.6"} s.source_files = 'Sources/**/*' diff --git a/Sources/M13CheckboxPathPresets.swift b/Sources/M13CheckboxPathPresets.swift index 1826cb1..3fef062 100644 --- a/Sources/M13CheckboxPathPresets.swift +++ b/Sources/M13CheckboxPathPresets.swift @@ -106,17 +106,17 @@ internal class M13CheckboxPathPresets { // On the corner let cos2Theta: CGFloat = cos(2.0 * theta) let sin2Theta: CGFloat = sin(2.0 * theta) - let sqrtV: CGFloat = sqrt(((4.0 * cornerRadius) - size) * size) - let powV: CGFloat = pow((2.0 * cornerRadius) + size, 2.0) + let powC: CGFloat = pow((-2.0 * cornerRadius) + size, 2.0) let a: CGFloat = size * (3.0 + cos2Theta + sin2Theta) let b: CGFloat = -2.0 * cornerRadius * (cos(theta) + sin(theta)) - let c: CGFloat = sqrtV + (powV * sin2Theta) + let c: CGFloat = (((4.0 * cornerRadius) - size) * size) + (powC * sin2Theta) let d: CGFloat = size * cos(theta) * (cos(theta) - sin(theta)) let e: CGFloat = 2.0 * cornerRadius * sin(theta) * (cos(theta) + sin(theta)) - let x: CGFloat = 0.25 * (a + (2.0 * (b + c) * cos(theta))) + (boxLineWidth / 2.0) - let y: CGFloat = 0.5 * (d + e - (c * sin(theta))) + (boxLineWidth / 2.0) + let x: CGFloat = 0.25 * (a + (2.0 * (b + sqrt(c)) * cos(theta))) - boxLineWidth + let y: CGFloat = 0.50 * (d + e - (sqrt(c) * sin(theta))) + boxLineWidth + return CGPoint(x: x, y: y) }