mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Replaced snap util function with std::clamp.
This commit is contained in:
@@ -473,7 +473,7 @@ int LayerWidget::resizeGetHeight(int newWidth) {
|
||||
_tillTop = _tillBottom = true;
|
||||
return windowHeight;
|
||||
}
|
||||
auto newTop = snap(
|
||||
auto newTop = std::clamp(
|
||||
windowHeight / 24,
|
||||
st::infoLayerTopMinimal,
|
||||
st::infoLayerTopMaximal);
|
||||
|
@@ -41,7 +41,7 @@ namespace {
|
||||
constexpr auto kMaxNotificationsCount = 5;
|
||||
|
||||
[[nodiscard]] int CurrentCount() {
|
||||
return snap(
|
||||
return std::clamp(
|
||||
Core::App().settings().notificationsCount(),
|
||||
1,
|
||||
kMaxNotificationsCount);
|
||||
|
Reference in New Issue
Block a user