From 47523054b2f67c5689582040055752846556463b Mon Sep 17 00:00:00 2001 From: ryanzhao Date: Wed, 16 Nov 2022 15:40:49 +1100 Subject: [PATCH] slightly reduce max width of media message on iPad --- Session/Conversations/Message Cells/VisibleMessageCell.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Session/Conversations/Message Cells/VisibleMessageCell.swift b/Session/Conversations/Message Cells/VisibleMessageCell.swift index 567abe565..2c47807d8 100644 --- a/Session/Conversations/Message Cells/VisibleMessageCell.swift +++ b/Session/Conversations/Message Cells/VisibleMessageCell.swift @@ -1025,11 +1025,12 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { static func getMaxWidth(for cellViewModel: MessageViewModel, includingOppositeGutter: Bool = true) -> CGFloat { let screen: CGRect = UIScreen.main.bounds + let width: CGFloat = UIDevice.current.isIPad ? screen.width * 0.75 : screen.width let oppositeEdgePadding: CGFloat = (includingOppositeGutter ? gutterSize : contactThreadHSpacing) switch cellViewModel.variant { case .standardOutgoing: - return (screen.width - contactThreadHSpacing - oppositeEdgePadding) + return (width - contactThreadHSpacing - oppositeEdgePadding) case .standardIncoming, .standardIncomingDeleted: let isGroupThread = ( @@ -1038,7 +1039,7 @@ final class VisibleMessageCell: MessageCell, TappableLabelDelegate { ) let leftGutterSize = (isGroupThread ? leftGutterSize : contactThreadHSpacing) - return (screen.width - leftGutterSize - oppositeEdgePadding) + return (width - leftGutterSize - oppositeEdgePadding) default: preconditionFailure() }