mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-05 11:34:31 +08:00
feat: ui控制器接口设计
This commit is contained in:
1 parent
e99320c52d
commit
44276183bb
4 files changed
+65
No files matched your search
@@ -517,3 +517,11 @@ export function calStringSize(str: string) {
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
export function clamp(num: number, start: number, end: number) {
|
||||
const s = Math.min(start, end);
|
||||
const e = Math.max(start, end);
|
||||
if (num < s) return s;
|
||||
else if (num > e) return e;
|
||||
return num;
|
||||
}
|
||||
Reference in new issue
Block a user