Skip to content

Commit

Permalink
Revert "fixup"
Browse files Browse the repository at this point in the history
This reverts commit 314a5bd.
  • Loading branch information
kahayash authored and kahayash committed Jul 25, 2017
1 parent 9f1acb9 commit 60bd315
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions PagingKit/MenuView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public class PagingMenuView: UIScrollView {
guard let dataSource = dataSource else {
return
}

frameQueue = []
var containerWidth: CGFloat = 0
(0..<numberOfItem).forEach { (index) in
Expand Down Expand Up @@ -253,9 +253,10 @@ public class PagingMenuView: UIScrollView {
}
}

func align() {
private func align() {
visibleCells.forEach { (cell) in
cell.frame.origin = CGPoint(x: frameQueue[cell.index].origin.x, y: bounds.minY)
let leftEdge = (0..<cell.index).reduce(CGFloat(0)) { (sum, idx) in sum + frameQueue[idx].width }
cell.frame.origin = CGPoint(x: leftEdge, y: bounds.minY)
cell.frame.size = CGSize(width: frameQueue[cell.index].width, height: bounds.height)
}
}
Expand Down

0 comments on commit 60bd315

Please sign in to comment.