Allow media reordering when sending an album.

This commit is contained in:
John Preston
2017-12-25 22:26:08 +03:00
parent 5d18d7c813
commit 1fc7dabd3e
9 changed files with 832 additions and 202 deletions

View File

@@ -454,9 +454,11 @@ std::vector<float64> ComplexLayouter::CropRatios(
return ranges::view::all(
ratios
) | ranges::view::transform([&](float64 ratio) {
constexpr auto kMaxRatio = 2.75;
constexpr auto kMinRatio = 0.6667;
return (averageRatio > 1.1)
? snap(ratio, 1., 1.7)
: snap(ratio, 0.66667, 1.);
? snap(ratio, 1., kMaxRatio)
: snap(ratio, kMinRatio, 1.);
}) | ranges::to_vector;
}