forked from mirrors/linphone-iphone
fix multiparts alignment
This commit is contained in:
parent
942db35732
commit
de3321646f
2 changed files with 10 additions and 10 deletions
|
|
@ -679,7 +679,7 @@
|
|||
imagesw = sSize.width;
|
||||
max_imagesw = MAX(max_imagesw, imagesw);
|
||||
originy = max_imagesh+IMAGE_DEFAULT_MARGIN;
|
||||
max_imagesh = sSize.height;
|
||||
max_imagesh += sSize.height;
|
||||
originx = sSize.width;
|
||||
} else {
|
||||
max_imagesw = MAX(max_imagesw, imagesw);
|
||||
|
|
@ -691,6 +691,9 @@
|
|||
contentView.fileUrls = fileUrls;
|
||||
[_finalAssetView addSubview:contentView];
|
||||
}
|
||||
CGRect imgFrame = self.finalAssetView.frame;
|
||||
imgFrame.size = CGSizeMake(max_imagesw, max_imagesh);
|
||||
self.finalAssetView.frame = imgFrame;
|
||||
_finalImage.hidden = YES;
|
||||
} else {
|
||||
// Resizing Image view
|
||||
|
|
@ -706,10 +709,8 @@
|
|||
const char *utf8Text = linphone_chat_message_get_text_content(self.message);
|
||||
|
||||
CGRect textFrame = self.messageText.frame;
|
||||
if (_contentViews.count > 0)
|
||||
textFrame.origin = CGPointMake(textFrame.origin.x, self.finalAssetView.frame.origin.y + self.finalAssetView.frame.size.height-10);
|
||||
else if (_finalImage.image)
|
||||
textFrame.origin = CGPointMake(textFrame.origin.x, self.finalAssetView.frame.origin.y + self.finalAssetView.frame.size.height);
|
||||
if (_contentViews.count > 0 || _finalImage.image)
|
||||
textFrame.origin = CGPointMake(textFrame.origin.x, self.finalAssetView.frame.origin.y + self.finalAssetView.frame.size.height);
|
||||
else
|
||||
// When image hasn't be download
|
||||
textFrame.origin = CGPointMake(textFrame.origin.x, _imageSubView.frame.size.height + _imageSubView.frame.origin.y - 10);
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 44;
|
|||
if (imagesw > width) {
|
||||
imagesw = sSize.width;
|
||||
max_imagesw = MAX(max_imagesw, imagesw);
|
||||
max_imagesh = imagesh;
|
||||
max_imagesh += imagesh;
|
||||
imagesh = sSize.height;
|
||||
} else {
|
||||
max_imagesw = MAX(max_imagesw, imagesw);
|
||||
|
|
@ -507,22 +507,21 @@ static const CGFloat CELL_MESSAGE_Y_MARGIN = 44;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
max_imagesh += imagesh;
|
||||
|
||||
size = CGSizeMake(max_imagesw, max_imagesh);
|
||||
CGSize textSize = CGSizeMake(0, 0);
|
||||
if (![messageText isEqualToString:@"🗻"]) {
|
||||
textSize = [self computeBoundingBox:messageText
|
||||
size:CGSizeMake(width - CELL_MESSAGE_X_MARGIN - 4, CGFLOAT_MAX)
|
||||
size:CGSizeMake(max_imagesw , CGFLOAT_MAX)
|
||||
font:messageFont];
|
||||
size.height += textSize.height;
|
||||
}
|
||||
|
||||
// add size for message text
|
||||
size.height += textSize.height;
|
||||
size.width = MAX(textSize.width, size.width);
|
||||
size.width = MAX(size.width + CELL_MESSAGE_X_MARGIN, CELL_MIN_WIDTH);
|
||||
size.height = MAX(size.height + CELL_MESSAGE_Y_MARGIN, CELL_MIN_HEIGHT);
|
||||
size.height = MAX(size.height + CELL_MESSAGE_Y_MARGIN, CELL_MIN_HEIGHT) ;
|
||||
return size;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue