Support room-defined height as well
Much like widget widths, it is acceptable for us to forget what everyone's height was previously at.
This commit is contained in:
parent
cfb583d193
commit
0d29d15a46
4 changed files with 98 additions and 14 deletions
|
@ -32,3 +32,11 @@ export function clamp(i: number, min: number, max: number): number {
|
|||
export function sum(...i: number[]): number {
|
||||
return [...i].reduce((p, c) => c + p, 0);
|
||||
}
|
||||
|
||||
export function percentageWithin(pct: number, min: number, max: number): number {
|
||||
return (pct * (max - min)) + min;
|
||||
}
|
||||
|
||||
export function percentageOf(val: number, min: number, max: number): number {
|
||||
return (val - min) / max;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue