From a31bd16d90eb34295f3df73ed9aeb8f5b9e3de23 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Mon, 25 Jun 2018 13:53:35 -0400 Subject: [PATCH] Respond to CR. --- .../Cells/OWSMessageBubbleView.m | 4 ++-- .../ConversationLayoutInfo.swift | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m index 399f6731c..a85bf7cc4 100644 --- a/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m +++ b/Signal/src/ViewControllers/ConversationView/Cells/OWSMessageBubbleView.m @@ -390,7 +390,7 @@ NS_ASSUME_NONNULL_BEGIN } } - OWSTextInsets *textInsets = self.layoutInfo.textInsets; + OWSDirectionalEdgeInsets *textInsets = self.layoutInfo.textInsets; OWSAssert(textInsets); OWSMessageTextView *_Nullable bodyTextView = nil; @@ -862,7 +862,7 @@ NS_ASSUME_NONNULL_BEGIN return CGSizeZero; } - OWSTextInsets *textInsets = self.layoutInfo.textInsets; + OWSDirectionalEdgeInsets *textInsets = self.layoutInfo.textInsets; OWSAssert(textInsets); CGFloat hMargins = textInsets.leading + textInsets.trailing; diff --git a/Signal/src/ViewControllers/ConversationView/ConversationLayoutInfo.swift b/Signal/src/ViewControllers/ConversationView/ConversationLayoutInfo.swift index c8adfda1e..c120641de 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationLayoutInfo.swift +++ b/Signal/src/ViewControllers/ConversationView/ConversationLayoutInfo.swift @@ -5,7 +5,7 @@ import Foundation @objc -public class OWSTextInsets: NSObject { +public class OWSDirectionalEdgeInsets: NSObject { @objc public let leading: CGFloat @objc public let trailing: CGFloat @@ -13,10 +13,10 @@ public class OWSTextInsets: NSObject { @objc public let bottom: CGFloat @objc - public required init(leading: CGFloat = 0, - trailing: CGFloat = 0, - top: CGFloat = 0, - bottom: CGFloat = 0) { + public required init(top: CGFloat = 0, + leading: CGFloat = 0, + bottom: CGFloat = 0, + trailing: CGFloat = 0) { self.leading = leading self.trailing = trailing @@ -63,7 +63,7 @@ public class ConversationLayoutInfo: NSObject { @objc public var maxMessageWidth: CGFloat = 0 @objc public var maxFooterWidth: CGFloat = 0 - @objc public var textInsets = OWSTextInsets() + @objc public var textInsets = OWSDirectionalEdgeInsets() @objc public required init(thread: TSThread) { @@ -122,9 +122,9 @@ public class ConversationLayoutInfo: NSObject { // negative value. let textInsetBottom = max(0, 12 - abs(messageTextFont.descender)) - textInsets = OWSTextInsets(leading: 12, - trailing: 12, - top: textInsetTop, - bottom: textInsetBottom) + textInsets = OWSDirectionalEdgeInsets(top: textInsetTop, + leading: 12, + bottom: textInsetBottom, + trailing: 12) } }