Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASTextNode] Implement an example comparing ASTextNode 1 & 2 behavior. #570

Merged
merged 22 commits into from
Oct 17, 2017
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/ASTextNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
// Add the constrained size back textContainerInset
size.width += (_textContainerInset.left + _textContainerInset.right);
size.height += (_textContainerInset.top + _textContainerInset.bottom);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wsdwsd0829 you can delete these whitespace changes, and also revert the diffs to Kittens / CatDealsCollectionView / ASDKgram.

Will catch up with you offline to talk about potentially putting the new view controller in examples_extra/TextStressTest; this would reduce some of the other boilerplate and might help us centralize our reproduction cases for text drawing issues.


return CGSizeMake(std::fmin(size.width, originalConstrainedSize.width),
std::fmin(size.height, originalConstrainedSize.height));
}
Expand Down
6 changes: 3 additions & 3 deletions Source/ASTextNode2.mm
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ - (CGSize)calculateSizeThatFits:(CGSize)constrainedSize
NSMutableAttributedString *mutableText = [attributedText mutableCopy];
[self prepareAttributedStringForDrawing:mutableText];
ASTextLayout *layout = [ASTextNode2 compatibleLayoutWithContainer:container text:mutableText];

[self setNeedsDisplay];

return layout.textBoundingSize;
}

Expand Down Expand Up @@ -415,7 +415,7 @@ + (ASTextLayout *)compatibleLayoutWithContainer:(ASTextContainer *)container
if (!CGRectContainsRect(maxRect, containerBounds)) {
continue;
}

// Now check container params.
ASTextContainer *otherContainer = layout.container;
if (!UIEdgeInsetsEqualToEdgeInsets(container.insets, otherContainer.insets)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down Expand Up @@ -30,6 +40,16 @@
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "29x29",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions examples/FlexLayoutExamples/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
target 'Sample' do
#pod 'Texture', :path => '../..'
pod 'Texture/Yoga', :path => '../..'
end
Loading