shift-shell/components/mobileshell/qml/components/util.js
Devin Lin 0775c56153 windowplugin: Extract out windowutil from mobileshell to separate plugin
This allows us in the future to use mobileshell without having the WindowUtil singleton loaded (which does a bunch of wayland calls that aren't necessary for most applications).
2023-03-15 15:12:23 +00:00

9 lines
257 B
JavaScript

// SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
// SPDX-License-Identifier: GPL-2.0-or-later
/**
* Applies both the min and max functions to a value.
*/
function applyMinMaxRange(min, max, num) {
return Math.min(max, Math.max(min, num));
}