Slightly refactored group call members.

This commit is contained in:
23rd 2020-12-01 15:33:57 +03:00
parent 309b3a6f96
commit 43ee8a402c

View file

@ -33,11 +33,10 @@ namespace Calls {
namespace { namespace {
constexpr auto kBlobsEnterDuration = crl::time(250); constexpr auto kBlobsEnterDuration = crl::time(250);
constexpr auto kRowBlobRadiusFactor = (float)(50. / 57.); constexpr auto kLevelDuration = 100. + 500. * 0.23;
constexpr auto kLevelDuration = 100. + 500. * 0.33; constexpr auto kBlobScale = 0.605;
constexpr auto kScaleSmall = 0.704 - 0.1; constexpr auto kMinorBlobFactor = 0.9f;
constexpr auto kScaleSmallMin = 0.926; constexpr auto kUserpicMinScale = 0.8;
constexpr auto kScaleSmallMax = (float)(kScaleSmallMin + kScaleSmall);
constexpr auto kMaxLevel = 1.; constexpr auto kMaxLevel = 1.;
constexpr auto kWideScale = 5; constexpr auto kWideScale = 5;
@ -45,21 +44,17 @@ auto RowBlobs() -> std::array<Ui::Paint::Blobs::BlobData, 2> {
return { { return { {
{ {
.segmentsCount = 6, .segmentsCount = 6,
.minScale = (kScaleSmallMin / kScaleSmallMax) * 0.9f, .minScale = kBlobScale * kMinorBlobFactor,
.minRadius = st::groupCallRowBlobMinRadius .minRadius = st::groupCallRowBlobMinRadius * kMinorBlobFactor,
* kRowBlobRadiusFactor * 0.9f, .maxRadius = st::groupCallRowBlobMaxRadius * kMinorBlobFactor,
.maxRadius = st::groupCallRowBlobMaxRadius
* kRowBlobRadiusFactor * 0.9f,
.speedScale = 1., .speedScale = 1.,
.alpha = .5, .alpha = .5,
}, },
{ {
.segmentsCount = 8, .segmentsCount = 8,
.minScale = kScaleSmallMin / kScaleSmallMax, .minScale = kBlobScale,
.minRadius = st::groupCallRowBlobMinRadius .minRadius = (float)st::groupCallRowBlobMinRadius,
* kRowBlobRadiusFactor, .maxRadius = (float)st::groupCallRowBlobMaxRadius,
.maxRadius = st::groupCallRowBlobMaxRadius
* kRowBlobRadiusFactor,
.speedScale = 1., .speedScale = 1.,
.alpha = .2, .alpha = .2,
}, },
@ -359,9 +354,10 @@ auto Row::generatePaintUserpicCallback() -> PaintRoundImageCallback {
p.setOpacity(1.); p.setOpacity(1.);
const auto enter = _speakingAnimation->enter; const auto enter = _speakingAnimation->enter;
const auto scaleAvatar = 0.8 const auto &minScale = kUserpicMinScale;
+ 0.2 * _speakingAnimation->blobs.currentLevel(); const auto scaleUserpic = minScale
const auto scale = scaleAvatar * enter + 1. * (1. - enter); + (1. - minScale) * _speakingAnimation->blobs.currentLevel();
const auto scale = scaleUserpic * enter + 1. * (1. - enter);
if (scale == 1.) { if (scale == 1.) {
peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size); peer()->paintUserpicLeft(p, userpic, x, y, outerWidth, size);
} else { } else {