mirror of https://github.com/procxx/kepka.git
Fix nice vote percents.
This commit is contained in:
parent
3dd2a6bb5b
commit
5ab1cd405a
|
@ -6578,7 +6578,6 @@ void HistoryWidget::drawPinnedBar(Painter &p) {
|
||||||
Expects(_pinnedBar != nullptr);
|
Expects(_pinnedBar != nullptr);
|
||||||
|
|
||||||
auto top = _topBar->bottomNoMargins();
|
auto top = _topBar->bottomNoMargins();
|
||||||
Text *from = 0, *text = 0;
|
|
||||||
bool serviceColor = false, hasForward = readyToForward();
|
bool serviceColor = false, hasForward = readyToForward();
|
||||||
ImagePtr preview;
|
ImagePtr preview;
|
||||||
p.fillRect(myrtlrect(0, top, width(), st::historyReplyHeight), st::historyPinnedBg);
|
p.fillRect(myrtlrect(0, top, width(), st::historyReplyHeight), st::historyPinnedBg);
|
||||||
|
|
|
@ -88,6 +88,12 @@ void AdjustPercentCount(gsl::span<PercentCounterItem> items, int left) {
|
||||||
break;
|
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;
|
const auto equal = j - i;
|
||||||
if (equal <= left) {
|
if (equal <= left) {
|
||||||
left -= equal;
|
left -= equal;
|
||||||
|
|
Loading…
Reference in New Issue