fix pan gesture of message cell

pull/647/head
ryanzhao 3 years ago
parent a123b36a47
commit e2d9ba6882

@ -39,9 +39,9 @@ final class VisibleMessageCell: MessageCell, UITextViewDelegate, BodyTextViewDel
// MARK: - UI Components // MARK: - UI Components
private lazy var viewsToMoveForReply: [UIView] = [ private lazy var viewsToMoveForReply: [UIView] = [
bubbleView, snContentView,
bubbleBackgroundView,
profilePictureView, profilePictureView,
moderatorIconImageView,
replyButton, replyButton,
timerView, timerView,
messageStatusImageView messageStatusImageView
@ -792,19 +792,22 @@ final class VisibleMessageCell: MessageCell, UITextViewDelegate, BodyTextViewDel
// MARK: - Convenience // MARK: - Convenience
private func getCornersToRound() -> UIRectCorner { private func getCornersToRound() -> UIRectCorner {
guard viewModel?.isOnlyMessageInCluster == false else { return .allCorners } return .allCorners
let direction: Direction = (viewModel?.variant == .standardOutgoing ? .outgoing : .incoming) // FIXME: Leave the code here just in case we want this again.
// guard viewModel?.isOnlyMessageInCluster == false else { return .allCorners }
switch (viewModel?.positionInCluster, direction) { //
case (.top, .outgoing): return [ .bottomLeft, .topLeft, .topRight ] // let direction: Direction = (viewModel?.variant == .standardOutgoing ? .outgoing : .incoming)
case (.middle, .outgoing): return [ .bottomLeft, .topLeft ] //
case (.bottom, .outgoing): return [ .bottomRight, .bottomLeft, .topLeft ] // switch (viewModel?.positionInCluster, direction) {
case (.top, .incoming): return [ .topLeft, .topRight, .bottomRight ] // case (.top, .outgoing): return [ .bottomLeft, .topLeft, .topRight ]
case (.middle, .incoming): return [ .topRight, .bottomRight ] // case (.middle, .outgoing): return [ .bottomLeft, .topLeft ]
case (.bottom, .incoming): return [ .topRight, .bottomRight, .bottomLeft ] // case (.bottom, .outgoing): return [ .bottomRight, .bottomLeft, .topLeft ]
case (.none, _): return .allCorners // case (.top, .incoming): return [ .topLeft, .topRight, .bottomRight ]
} // case (.middle, .incoming): return [ .topRight, .bottomRight ]
// case (.bottom, .incoming): return [ .topRight, .bottomRight, .bottomLeft ]
// case (.none, _): return .allCorners
// }
} }
private func getCornerMask(from rectCorner: UIRectCorner) -> CACornerMask { private func getCornerMask(from rectCorner: UIRectCorner) -> CACornerMask {

Loading…
Cancel
Save