From a6c15217c09e56e46349fe5a047ee05d04295185 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 25 Dec 2017 14:12:47 +0300 Subject: [PATCH] Fix grouped layout algorithm to match other apps. --- Telegram/SourceFiles/ui/grouped_layout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/grouped_layout.cpp b/Telegram/SourceFiles/ui/grouped_layout.cpp index 1bc06227ef..98af5d901f 100644 --- a/Telegram/SourceFiles/ui/grouped_layout.cpp +++ b/Telegram/SourceFiles/ui/grouped_layout.cpp @@ -113,7 +113,7 @@ Layouter::Layouter( , _maxHeight(maxWidth) , _minWidth(minWidth) , _spacing(spacing) -, _averageRatio(ranges::accumulate(_ratios, 0.) / _count) +, _averageRatio(ranges::accumulate(_ratios, 1.) / _count) , _maxSizeRatio(_maxWidth / float64(_maxHeight)) { }