Skip to content

Commit

Permalink
fix zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
lkzhao committed Dec 17, 2019
1 parent 99ae28f commit 99bb69b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CollectionKit2/Sources/CollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ open class CollectionView: UIScrollView {
isReloading = true

let oldContentOffset = contentOffset
contentSize = provider.layout(size: innerSize)
contentSize = provider.layout(size: innerSize) * zoomScale
if let offset = contentOffsetAdjustFn?() {
contentOffset = offset
}
Expand Down
3 changes: 3 additions & 0 deletions CollectionKit2/Sources/Util.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func * (left: CGFloat, right: CGPoint) -> CGPoint {
func * (left: CGPoint, right: CGPoint) -> CGPoint {
return CGPoint(x: left.x*right.x, y: left.y*right.y)
}
func * (left: CGSize, right: CGFloat) -> CGSize {
return CGSize(width: left.width * right, height: left.height * right)
}
prefix func - (point: CGPoint) -> CGPoint {
return CGPoint.zero - point
}
Expand Down

0 comments on commit 99bb69b

Please sign in to comment.