Skip to content

Commit

Permalink
Fixed issue #69
Browse files Browse the repository at this point in the history
Multiple commits caused math issues by modifying the positioning
equations. Copied the original equations back in, and re-modified them
to keep build time low
  • Loading branch information
brandon-mcquilkin-kr committed Oct 5, 2016
1 parent 18db06b commit 9b185ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions M13Checkbox.podspec
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/**/*'

Expand Down
10 changes: 5 additions & 5 deletions Sources/M13CheckboxPathPresets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9b185ca

Please sign in to comment.