Skip to content

Commit

Permalink
Merge branch 'main' into muukii/patch-1686224794-from-main
Browse files Browse the repository at this point in the history
  • Loading branch information
muukii committed Aug 9, 2023
2 parents 85aa06d + 5ebbc98 commit dfbf205
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Sources/LayoutSpecBuilders/Modifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ fileprivate func combineInsets(_ lhs: UIEdgeInsets, rhs: UIEdgeInsets) -> UIEdge
return base
}

// MARK: - Offset
extension _ASLayoutElementType {

public func offset(width: CGFloat = 0, height: CGFloat = 0) -> InsetLayout<Self> {
return offset(.init(width: width, height: height))
}

public func offset(_ size: CGSize) -> InsetLayout<Self> {
return padding(UIEdgeInsets(top: size.height, left: size.width, bottom: -size.height, right: -size.width))
}
}

// MARK: - Padding
extension _ASLayoutElementType {

Expand Down

0 comments on commit dfbf205

Please sign in to comment.