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

[TIMOB-24753]: iOS View sizes are incorrect in 6.1.0.GA (regression) #9120

Merged
merged 2 commits into from
Jun 9, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions iphone/Classes/TiUILabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ -(CGSize)sizeForFont:(CGFloat)suggestedWidth
// the string having trailing spaces when given size parameter width is equal to the expected return width, so we adjust it here.
maxSize.width += 0.00001;
}
CGSize returnVal = [value boundingRectWithSize:maxSize
options:NSStringDrawingUsesLineFragmentOrigin
context:nil].size;
CGSize returnVal = [value size];
CGSize size = CGSizeMake(ceilf(returnVal.width), ceilf(returnVal.height));
if (shadowOffset.width > 0)
{
Expand Down
6 changes: 3 additions & 3 deletions iphone/Classes/TiViewProxy.m
Original file line number Diff line number Diff line change
Expand Up @@ -2712,21 +2712,21 @@ -(CGRect)computeChildSandbox:(TiViewProxy*)child withBounds:(CGRect)bounds
else if (!TiDimensionIsUndefined([child layoutProperties]->left) && !TiDimensionIsUndefined([child layoutProperties]->right) ) {
recalculateWidth = YES;
followsFillBehavior = YES;
desiredWidth = [child autoWidthForSize:CGSizeMake(bounds.size.width - offsetH,boundingHeight - offsetV)] + offsetH;
desiredWidth = [child autoWidthForSize:CGSizeMake(boundingWidth - offsetH,boundingHeight - offsetV)] + offsetH;
}
else if (!TiDimensionIsUndefined([child layoutProperties]->centerX) && !TiDimensionIsUndefined([child layoutProperties]->right) ) {
desiredWidth = 2 * ( boundingWidth - TiDimensionCalculateValue([child layoutProperties]->right, boundingWidth) - TiDimensionCalculateValue([child layoutProperties]->centerX, boundingWidth));
desiredWidth += offsetH;
}
else {
recalculateWidth = YES;
desiredWidth = [child autoWidthForSize:CGSizeMake(bounds.size.width - offsetH,boundingHeight - offsetV)] + offsetH;
desiredWidth = [child autoWidthForSize:CGSizeMake(boundingWidth - offsetH,boundingHeight - offsetV)] + offsetH;
}
}
else {
//This block takes care of auto,SIZE and FILL. If it is size ensure followsFillBehavior is set to false
recalculateWidth = YES;
desiredWidth = [child autoWidthForSize:CGSizeMake(bounds.size.width - offsetH,boundingHeight - offsetV)] + offsetH;
desiredWidth = [child autoWidthForSize:CGSizeMake(boundingWidth - offsetH,boundingHeight - offsetV)] + offsetH;
if (TiDimensionIsAutoSize(constraint)) {
followsFillBehavior = NO;
} else if(TiDimensionIsAutoFill(constraint)) {
Expand Down