Skip to content

Commit

Permalink
Fix CGPath+RoundedRect not actually rounding corners (wtf…)
Browse files Browse the repository at this point in the history
  • Loading branch information
iStefo committed Nov 2, 2018
1 parent a2b637e commit 412a3e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BXSwiftUtils/Math & Geometry/CGPath+RoundedRect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public extension CGPath
{
let start = CGPoint(x: bounds.minX, y: bounds.maxY - radius)
path.move(to: start)
path.addArc(tangent1End: start, tangent2End: CGPoint(x: bounds.minX + radius, y: bounds.maxY), radius: radius)
path.addArc(tangent1End: CGPoint(x: bounds.minX, y: bounds.maxY), tangent2End: CGPoint(x: bounds.minX + radius, y: bounds.maxY), radius: 5.0)
}
else
{
Expand All @@ -37,7 +37,7 @@ public extension CGPath
{
let start = CGPoint(x: bounds.maxX - radius, y: bounds.maxY)
path.addLine(to: start)
path.addArc(tangent1End: start, tangent2End: CGPoint(x: bounds.maxX, y: bounds.maxY - radius), radius: radius)
path.addArc(tangent1End: CGPoint(x: bounds.maxX, y: bounds.maxY), tangent2End: CGPoint(x: bounds.maxX, y: bounds.maxY - radius), radius: radius)
}
else
{
Expand All @@ -48,7 +48,7 @@ public extension CGPath
{
let start = CGPoint(x: bounds.maxX, y: bounds.minY + radius)
path.addLine(to: start)
path.addArc(tangent1End: start, tangent2End: CGPoint(x: bounds.maxX - radius, y: bounds.minY), radius: radius)
path.addArc(tangent1End: CGPoint(x: bounds.maxX, y: bounds.minY), tangent2End: CGPoint(x: bounds.maxX - radius, y: bounds.minY), radius: radius)
}
else
{
Expand All @@ -59,7 +59,7 @@ public extension CGPath
{
let start = CGPoint(x: bounds.minX + radius, y: bounds.minY)
path.addLine(to: start)
path.addArc(tangent1End: start, tangent2End: CGPoint(x: bounds.minX, y: bounds.minY + radius), radius: radius)
path.addArc(tangent1End: CGPoint(x: bounds.minX, y: bounds.minY), tangent2End: CGPoint(x: bounds.minX, y: bounds.minY + radius), radius: radius)
}
else
{
Expand Down

0 comments on commit 412a3e3

Please sign in to comment.