Răsfoiți Sursa

Merge pull request #1247 from deltachat/stickers_merge_unify_size

keep sticker size on rotation
cyBerta 4 ani în urmă
părinte
comite
8f4ab8e9e0
1 a modificat fișierele cu 1 adăugiri și 3 ștergeri
  1. 1 3
      deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

+ 1 - 3
deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

@@ -108,7 +108,6 @@ class ImageTextCell: BaseMessageCell {
         var width = width
         var height = height
 
-        let orientation = UIApplication.shared.statusBarOrientation
         self.imageHeightConstraint?.isActive = false
         self.imageWidthConstraint?.isActive = false
 
@@ -119,8 +118,7 @@ class ImageTextCell: BaseMessageCell {
         }
 
         // check if sticker has the allowed maximal width
-        let factor: CGFloat = orientation.isLandscape ? 3 / 8 : 1 / 2
-        let maxWidth  = UIScreen.main.bounds.width * factor
+        let maxWidth  = min(UIScreen.main.bounds.height, UIScreen.main.bounds.width) / 2
         if width > maxWidth {
             height = (height / width) * maxWidth
             width = maxWidth