Fix media caption edit admin event log entries.

This commit is contained in:
John Preston 2017-07-18 21:59:53 +03:00
parent 077e128e9a
commit a513b1c7b3
1 changed files with 10 additions and 14 deletions

View File

@ -1092,11 +1092,9 @@ void HistoryMessage::initDimensions() {
} }
if (entry) { if (entry) {
accumulate_max(_maxw, entry->_page->maxWidth()); accumulate_max(_maxw, entry->_page->maxWidth());
_minh += entry->_page->minHeight();
} }
} }
if (entry) {
_minh += entry->_page->minHeight();
}
} else if (_media) { } else if (_media) {
_media->initDimensions(); _media->initDimensions();
_maxw = _media->maxWidth(); _maxw = _media->maxWidth();
@ -1840,7 +1838,7 @@ int HistoryMessage::performResizeGetHeight() {
_media->resizeGetHeight(_maxw); _media->resizeGetHeight(_maxw);
} }
if (entry) { if (entry) {
entry->_page->resizeGetHeight(_maxw); _height += entry->_page->resizeGetHeight(countGeometry().width());
} }
} else { } else {
if (emptyText()) { if (emptyText()) {
@ -1864,31 +1862,29 @@ int HistoryMessage::performResizeGetHeight() {
} }
if (mediaDisplayed) { if (mediaDisplayed) {
_height += _media->resizeGetHeight(contentWidth); _height += _media->resizeGetHeight(contentWidth);
} if (entry) {
if (entry) { _height += entry->_page->resizeGetHeight(countGeometry().width());
}
} else if (entry) {
_height += entry->_page->resizeGetHeight(contentWidth); _height += entry->_page->resizeGetHeight(contentWidth);
} }
} }
if (displayFromName()) { if (displayFromName()) {
auto g = countGeometry(); fromNameUpdated(countGeometry().width());
fromNameUpdated(g.width());
_height += st::msgNameFont->height; _height += st::msgNameFont->height;
} else if (via && !forwarded) { } else if (via && !forwarded) {
auto g = countGeometry(); via->resize(countGeometry().width() - st::msgPadding.left() - st::msgPadding.right());
via->resize(g.width() - st::msgPadding.left() - st::msgPadding.right());
_height += st::msgNameFont->height; _height += st::msgNameFont->height;
} }
if (displayForwardedFrom()) { if (displayForwardedFrom()) {
auto g = countGeometry(); auto fwdheight = ((forwarded->_text.maxWidth() > (countGeometry().width() - st::msgPadding.left() - st::msgPadding.right())) ? 2 : 1) * st::semiboldFont->height;
auto fwdheight = ((forwarded->_text.maxWidth() > (g.width() - st::msgPadding.left() - st::msgPadding.right())) ? 2 : 1) * st::semiboldFont->height;
_height += fwdheight; _height += fwdheight;
} }
if (reply) { if (reply) {
auto g = countGeometry(); reply->resize(countGeometry().width() - st::msgPadding.left() - st::msgPadding.right());
reply->resize(g.width() - st::msgPadding.left() - st::msgPadding.right());
_height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom(); _height += st::msgReplyPadding.top() + st::msgReplyBarSize.height() + st::msgReplyPadding.bottom();
} }
} else if (_media) { } else if (_media) {