Fix nice vote percents.

This commit is contained in:
John Preston 2019-04-23 18:03:17 +04:00
parent 3dd2a6bb5b
commit 5ab1cd405a
2 changed files with 6 additions and 1 deletions

View File

@ -6578,7 +6578,6 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
Expects(_pinnedBar != nullptr);
auto top = _topBar->bottomNoMargins();
Text *from = 0, *text = 0;
bool serviceColor = false, hasForward = readyToForward();
ImagePtr preview;
p.fillRect(myrtlrect(0, top, width(), st::historyReplyHeight), st::historyPinnedBg);

View File

@ -88,6 +88,12 @@ void AdjustPercentCount(gsl::span<PercentCounterItem> items, int left) {
break;
}
}
if (!items[i].remainder) {
// If this item has correct value in 'percent' we don't want
// to increment it to an incorrect one. This fixes a case with
// four items with three votes for three different items.
break;
}
const auto equal = j - i;
if (equal <= left) {
left -= equal;