mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-11 19:41:56 +01:00
Attempt 2 at scaling
Added some more logic for scaling to hopefully have a uniform state Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com>
This commit is contained in:
9
utils/scaleSize.ts
Normal file
9
utils/scaleSize.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Dimensions } from "react-native";
|
||||
|
||||
const { width: W, height: H } = Dimensions.get("window");
|
||||
|
||||
export const scaleSize = (size: number): number => {
|
||||
const widthRatio = W / 1920;
|
||||
const heightRatio = H / 1080;
|
||||
return size * Math.min(widthRatio, heightRatio);
|
||||
};
|
||||
Reference in New Issue
Block a user