Skip to content

Commit 07750d1

Browse files
author
Luc Dion
authored
Merge pull request #54 from mirego/reorder_margin
Undo recent changes to method margin(CGFloat, CGFloat, CGFloat, CGFloat)
2 parents e54a2d9 + 935573d commit 07750d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/PinLayout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public protocol PinLayout {
270270
/// - bottom: <#bottom description#>
271271
/// - right: <#right description#>
272272
/// - Returns: <#return value description#>
273-
@discardableResult func margin(_ top: CGFloat, _ right: CGFloat, _ bottom: CGFloat, _ left: CGFloat) -> PinLayout
273+
@discardableResult func margin(_ top: CGFloat, _ left: CGFloat, _ bottom: CGFloat, _ right: CGFloat) -> PinLayout
274274

275275
/// Normally if only either left or right has been specified, PinLayout will MOVE the view to apply left or right margins.
276276
/// This is also true even if the width has been set.

Sources/PinLayoutImpl.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ class PinLayoutImpl: PinLayout {
619619
}
620620

621621
@discardableResult
622-
func margin(_ top: CGFloat, _ right: CGFloat, _ bottom: CGFloat, _ left: CGFloat) -> PinLayout {
622+
func margin(_ top: CGFloat, _ left: CGFloat, _ bottom: CGFloat, _ right: CGFloat) -> PinLayout {
623623
marginTop = top
624624
marginLeft = left
625625
marginBottom = bottom
@@ -889,7 +889,7 @@ extension PinLayoutImpl {
889889

890890
fileprivate func applyJustify(rect: CGRect, betweenLeft left: CGFloat, andRight right: CGFloat) -> CGRect {
891891
let containerWidth = right - left - _marginLeft - _marginRight
892-
var remainingWidth = containerWidth - rect.width
892+
let remainingWidth = containerWidth - rect.width
893893
var justifyType = HorizontalAlign.left
894894

895895
if let justify = justify {
@@ -942,7 +942,7 @@ extension PinLayoutImpl {
942942

943943
fileprivate func applyAlign(rect: CGRect, betweenTop top: CGFloat, andBottom bottom: CGFloat) -> CGRect {
944944
let containerHeight = bottom - top - _marginTop - _marginBottom
945-
var remainingHeight = containerHeight - rect.height
945+
let remainingHeight = containerHeight - rect.height
946946
var alignType = VerticalAlign.top
947947

948948
if let align = align {

0 commit comments

Comments
 (0)