Permalink
Browse files

remove setting attachment of unknown original size to max image size

This was originally set to {1,1}, later maxImageSize. By not being Zero a custom subview for an image would get a chance to be loaded lazily, e.g. with DTLazyImageView. This behavior was changed since now a subview is also requested for a subview with size zero.
  • Loading branch information...
1 parent 85f84e7 commit 6fff25df272582a0204e3fc88d06202ab426f97d @odrobnik odrobnik committed Apr 2, 2013
Showing with 1 addition and 7 deletions.
  1. +1 −7 Core/Source/DTTextAttachment.m
@@ -205,18 +205,12 @@ + (DTTextAttachment *)textAttachmentWithElement:(DTHTMLElement *)element options
// adjust the display size if there is a restriction and it's too large
CGSize adjustedSize = displaySize;
- if (maxImageSize.width>0 && maxImageSize.height>0)
+ if (!CGSizeEqualToSize(maxImageSize, CGSizeZero))
{
if (maxImageSize.width < displaySize.width || maxImageSize.height < displaySize.height)
{
adjustedSize = sizeThatFitsKeepingAspectRatio(displaySize, maxImageSize);
}
-
- // still no display size? use max size
- if (CGSizeEqualToSize(displaySize, CGSizeZero))
- {
- adjustedSize = maxImageSize;
- }
}
attachment.contentType = attachmentType;

0 comments on commit 6fff25d

Please sign in to comment.