slightly reduce max width of media message on iPad

This commit is contained in:
ryanzhao 2022-11-16 15:40:49 +11:00
parent d827bb2770
commit 47523054b2
1 changed files with 3 additions and 2 deletions

View File

@ -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()
}