Skip to content

Commit

Permalink
Migrate placeholder example project from 1.0 to 2.x (TextureGroup#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
ay8s authored and mikezucc committed Nov 7, 2018
1 parent 879db03 commit 7d81bca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples_extra/Placeholders/Sample/PostNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ - (UIImage *)placeholderImage

- (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
{
CGSize textSize = [_textNode measure:constrainedSize];
CGSize shareSize = [_needyChildNode measure:constrainedSize];
CGSize textSize = [_textNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
CGSize shareSize = [_needyChildNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;

return CGSizeMake(constrainedSize.width, textSize.height + 10.0 + shareSize.height);
}
Expand Down
4 changes: 2 additions & 2 deletions examples_extra/Placeholders/Sample/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ - (void)viewWillLayoutSubviews
CGFloat constrainedWidth = CGRectGetWidth(bounds);
CGSize constrainedSize = CGSizeMake(constrainedWidth - 2 * padding, CGFLOAT_MAX);

CGSize postSize = [_postNode measure:constrainedSize];
CGSize imageSize = [_imageNode measure:constrainedSize];
CGSize postSize = [_postNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;
CGSize imageSize = [_imageNode layoutThatFits:ASSizeRangeMake(CGSizeZero, constrainedSize)].size;

_imageNode.frame = (CGRect){padding, padding, imageSize};
_postNode.frame = (CGRect){padding, CGRectGetMaxY(_imageNode.frame) + 10.0, postSize};
Expand Down

0 comments on commit 7d81bca

Please sign in to comment.