Respond to CR.

pull/1/head
Matthew Chen 7 years ago
parent 7847db7e1c
commit a31bd16d90

@ -390,7 +390,7 @@ NS_ASSUME_NONNULL_BEGIN
} }
} }
OWSTextInsets *textInsets = self.layoutInfo.textInsets; OWSDirectionalEdgeInsets *textInsets = self.layoutInfo.textInsets;
OWSAssert(textInsets); OWSAssert(textInsets);
OWSMessageTextView *_Nullable bodyTextView = nil; OWSMessageTextView *_Nullable bodyTextView = nil;
@ -862,7 +862,7 @@ NS_ASSUME_NONNULL_BEGIN
return CGSizeZero; return CGSizeZero;
} }
OWSTextInsets *textInsets = self.layoutInfo.textInsets; OWSDirectionalEdgeInsets *textInsets = self.layoutInfo.textInsets;
OWSAssert(textInsets); OWSAssert(textInsets);
CGFloat hMargins = textInsets.leading + textInsets.trailing; CGFloat hMargins = textInsets.leading + textInsets.trailing;

@ -5,7 +5,7 @@
import Foundation import Foundation
@objc @objc
public class OWSTextInsets: NSObject { public class OWSDirectionalEdgeInsets: NSObject {
@objc public let leading: CGFloat @objc public let leading: CGFloat
@objc public let trailing: CGFloat @objc public let trailing: CGFloat
@ -13,10 +13,10 @@ public class OWSTextInsets: NSObject {
@objc public let bottom: CGFloat @objc public let bottom: CGFloat
@objc @objc
public required init(leading: CGFloat = 0, public required init(top: CGFloat = 0,
trailing: CGFloat = 0, leading: CGFloat = 0,
top: CGFloat = 0, bottom: CGFloat = 0,
bottom: CGFloat = 0) { trailing: CGFloat = 0) {
self.leading = leading self.leading = leading
self.trailing = trailing self.trailing = trailing
@ -63,7 +63,7 @@ public class ConversationLayoutInfo: NSObject {
@objc public var maxMessageWidth: CGFloat = 0 @objc public var maxMessageWidth: CGFloat = 0
@objc public var maxFooterWidth: CGFloat = 0 @objc public var maxFooterWidth: CGFloat = 0
@objc public var textInsets = OWSTextInsets() @objc public var textInsets = OWSDirectionalEdgeInsets()
@objc @objc
public required init(thread: TSThread) { public required init(thread: TSThread) {
@ -122,9 +122,9 @@ public class ConversationLayoutInfo: NSObject {
// negative value. // negative value.
let textInsetBottom = max(0, 12 - abs(messageTextFont.descender)) let textInsetBottom = max(0, 12 - abs(messageTextFont.descender))
textInsets = OWSTextInsets(leading: 12, textInsets = OWSDirectionalEdgeInsets(top: textInsetTop,
trailing: 12, leading: 12,
top: textInsetTop, bottom: textInsetBottom,
bottom: textInsetBottom) trailing: 12)
} }
} }

Loading…
Cancel
Save