mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
fixed mouse remap
This commit is contained in:
@@ -32,6 +32,11 @@ from typing import Hashable
|
||||
from typing import TypeVar
|
||||
|
||||
|
||||
# =====
|
||||
def remap(value: int, in_min: int, in_max: int, out_min: int, out_max: int) -> int:
|
||||
return (value - in_min) * (out_max - out_min) // (in_max - in_min) + out_min
|
||||
|
||||
|
||||
# =====
|
||||
def efmt(err: Exception) -> str:
|
||||
return f"{type(err).__name__}: {err}"
|
||||
|
||||
Reference in New Issue
Block a user