From 3bc692c93847d9af6fb2204e064de9355a2dd328 Mon Sep 17 00:00:00 2001 From: ricky cancro <@pinterest.com> Date: Wed, 12 Aug 2015 15:29:26 -0700 Subject: [PATCH] comments --- AsyncDisplayKit/ASDisplayNode.h | 6 ++++-- AsyncDisplayKit/ASImageNode.mm | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/AsyncDisplayKit/ASDisplayNode.h b/AsyncDisplayKit/ASDisplayNode.h index 0311a3028d..7fcfbd5999 100644 --- a/AsyncDisplayKit/ASDisplayNode.h +++ b/AsyncDisplayKit/ASDisplayNode.h @@ -186,8 +186,10 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)(); @property (nonatomic, readonly, assign) ASSizeRange constrainedSizeForCalculatedLayout; /** - * @abstract Used by some implementations of measureWithSizeRange: to provide an intrisic content size - * to a node when one cannot be computed from its subnodes + * @abstract Provides a default intrinsic content size for calculateSizeThatFits:. This is useful when laying out + * a node that either has no intrinsic content size or should be laid out at a different size than its intrinsic content + * size. For example, this property could be set on an ASImageNode to display at a size different from the underlying + * image size. * * @return The preferred frame size of this node */ diff --git a/AsyncDisplayKit/ASImageNode.mm b/AsyncDisplayKit/ASImageNode.mm index cb60239730..cf90d2f7fa 100644 --- a/AsyncDisplayKit/ASImageNode.mm +++ b/AsyncDisplayKit/ASImageNode.mm @@ -111,6 +111,7 @@ - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize { ASDN::MutexLocker l(_imageLock); + // if a preferredFrameSize is set, call the superclass to return that instead of using the image size. if (CGSizeEqualToSize(self.preferredFrameSize, CGSizeZero) == NO) return [super calculateSizeThatFits:constrainedSize]; else if (_image)