mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 10:01:53 +08:00
ocr
This commit is contained in:
@@ -83,6 +83,16 @@ export var tools = new function() {
|
||||
return `${hours}:${mins}:${secs}.${millis}`;
|
||||
};
|
||||
|
||||
self.remap = function(x, a1, b1, a2, b2) {
|
||||
let remapped = Math.round((x - a1) / b1 * (b2 - a2) + a2);
|
||||
if (remapped < a2) {
|
||||
return a2;
|
||||
} else if (remapped > b2) {
|
||||
return b2;
|
||||
}
|
||||
return remapped;
|
||||
};
|
||||
|
||||
/************************************************************************/
|
||||
|
||||
self.el = new function() {
|
||||
|
||||
Reference in New Issue
Block a user