We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c55f4f6 commit e959028Copy full SHA for e959028
Sources/Extensions/UIView+PinLayout.swift
@@ -122,8 +122,14 @@ extension UIView: AutoSizeCalculable {
122
}
123
124
public func setAutoSizingRect(_ rect: CGRect, margins: PEdgeInsets) {
125
+ #if os(tvOS)
126
+ let rectWithMargins = UIEdgeInsetsInsetRect(rect, margins)
127
+ #else
128
+ let rectWithMargins = rect.inset(by: margins)
129
+ #endif
130
+
131
self.autoSizingRect = Coordinates<View>.adjustRectToDisplayScale(rect)
- self.autoSizingRectWithMargins = Coordinates<View>.adjustRectToDisplayScale(rect.inset(by: margins))
132
+ self.autoSizingRectWithMargins = Coordinates<View>.adjustRectToDisplayScale(rectWithMargins)
133
134
135
public func autoSizeThatFits(_ size: CGSize, layoutClosure: () -> Void) -> CGSize {
0 commit comments