Преглед на файлове

reduce minimal image width, scale small images depending on message text width

cyberta преди 4 години
родител
ревизия
37818bf6e2
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

+ 2 - 2
deltachat-ios/Chat/Views/Cells/ImageTextCell.swift

@@ -4,7 +4,7 @@ import DcCore
 import SDWebImage
 
 class ImageTextCell: BaseMessageCell {
-    let minImageWidth: CGFloat = 175
+    let minImageWidth: CGFloat = 125
     var imageHeightConstraint: NSLayoutConstraint?
     var imageWidthConstraint: NSLayoutConstraint?
 
@@ -140,7 +140,7 @@ class ImageTextCell: BaseMessageCell {
             } else {
                 if width == minImageWidth {
                     // very small width images should be forced to not be scaled down further
-                    self.imageWidthConstraint = self.contentImageView.widthAnchor.constraint(equalToConstant: width)
+                    self.imageWidthConstraint = self.contentImageView.widthAnchor.constraint(greaterThanOrEqualToConstant: width)
                 } else {
                     // large width images might scale down until the max allowed text width
                     self.imageWidthConstraint = self.contentImageView.widthAnchor.constraint(lessThanOrEqualToConstant: width)