Przeglądaj źródła

add explaining comments

cyberta 4 lat temu
rodzic
commit
8d3caf5c5d

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

@@ -139,8 +139,10 @@ class ImageTextCell: BaseMessageCell {
                                                                                          multiplier: width/height)
                                                                                          multiplier: width/height)
             } else {
             } else {
                 if width == minImageWidth {
                 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(equalToConstant: width)
                 } else {
                 } else {
+                    // large width images might scale down until the max allowed text width
                     self.imageWidthConstraint = self.contentImageView.widthAnchor.constraint(lessThanOrEqualToConstant: width)
                     self.imageWidthConstraint = self.contentImageView.widthAnchor.constraint(lessThanOrEqualToConstant: width)
                 }
                 }
                 self.imageHeightConstraint = self.contentImageView.heightAnchor.constraint(
                 self.imageHeightConstraint = self.contentImageView.heightAnchor.constraint(