2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 15:35:51 +00:00

Correctly show premium promo for custom reactions.

This commit is contained in:
John Preston
2022-08-30 10:53:07 +04:00
parent a3c110dafa
commit ebf6cea2f5
8 changed files with 75 additions and 47 deletions

View File

@@ -996,7 +996,7 @@ void ReactionPreview::paintEffect(QPainter &p) {
Data::Reactions::Type::Active);
const auto count = ranges::count(list, true, &Data::Reaction::premium);
const auto rows = (count + kReactionsPerRow - 1) / kReactionsPerRow;
const auto inrowmax = (count + rows - 1) / rows;
const auto inrowmax = rows ? ((count + rows - 1) / rows) : 1;
const auto inrowless = (inrowmax * rows - count);
const auto inrowmore = rows - inrowless;
const auto inmaxrows = inrowmore * inrowmax;