[Update] Main Page: Message Input Box Ratio. Save the ratio when window is resized.
This commit is contained in:
8
src-ui/utils/clampMinMax.js
Normal file
8
src-ui/utils/clampMinMax.js
Normal file
@@ -0,0 +1,8 @@
|
||||
export const clampMinMax = (value, min, max) => {
|
||||
return Math.min(Math.max(value, min), max);
|
||||
};
|
||||
|
||||
// console.log(clamp(5, 1, 10)); // 5 (範囲内)
|
||||
// console.log(clamp(-3, 0, 10)); // 0 (minより小さい)
|
||||
// console.log(clamp(15, 1, 10)); // 10 (maxより大きい)
|
||||
// console.log(clamp(7.5, 1, 10)); // 7.5 (範囲内、少数)
|
||||
Reference in New Issue
Block a user