diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp index d9449ca35..5b14bd7a9 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.cpp @@ -646,7 +646,7 @@ void FieldAutocompleteInner::paintEvent(QPaintEvent *e) { w = std::max(size.width(), 1); h = std::max(size.height(), 1); } else { - const auto coef = std::max( + const auto coef = std::min( std::min( (st::stickerPanSize.width() - st::buttonRadius * 2) / float64(document->dimensions.width()), (st::stickerPanSize.height() - st::buttonRadius * 2) / float64(document->dimensions.height())),