mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Replaced snap util function with std::clamp.
This commit is contained in:
@@ -1053,7 +1053,7 @@ bool ReadSetting(
|
||||
stream >> v;
|
||||
if (!CheckStreamStatus(stream)) return false;
|
||||
|
||||
Core::App().settings().setSongVolume(snap(v / 1e6, 0., 1.));
|
||||
Core::App().settings().setSongVolume(std::clamp(v / 1e6, 0., 1.));
|
||||
context.legacyRead = true;
|
||||
} break;
|
||||
|
||||
@@ -1062,7 +1062,7 @@ bool ReadSetting(
|
||||
stream >> v;
|
||||
if (!CheckStreamStatus(stream)) return false;
|
||||
|
||||
Core::App().settings().setVideoVolume(snap(v / 1e6, 0., 1.));
|
||||
Core::App().settings().setVideoVolume(std::clamp(v / 1e6, 0., 1.));
|
||||
context.legacyRead = true;
|
||||
} break;
|
||||
|
||||
|
@@ -80,7 +80,7 @@ QString StateDescription(const BlobState &state, tr::phrase<> activeText) {
|
||||
return activeText(tr::now);
|
||||
}, [](const Loading &data) {
|
||||
const auto percent = (data.size > 0)
|
||||
? snap((data.already * 100) / float64(data.size), 0., 100.)
|
||||
? std::clamp((data.already * 100) / float64(data.size), 0., 100.)
|
||||
: 0.;
|
||||
return tr::lng_emoji_set_loading(
|
||||
tr::now,
|
||||
|
Reference in New Issue
Block a user