mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 18:19:58 +00:00
Move window centering to utils
This commit is contained in:
@@ -8,3 +8,14 @@ export function getNextEllipsis (ellipsis) {
|
||||
else if (ellipsis === "...") "";
|
||||
};
|
||||
}
|
||||
|
||||
export function getWindowCenteredProps (refWin, width, height) {
|
||||
const centerX = refWin.left + (refWin.width / 2);
|
||||
const centerY = refWin.top + (refWin.height / 3);
|
||||
|
||||
return {
|
||||
width, height
|
||||
, left: Math.floor(centerX - width / 2)
|
||||
, top: Math.floor(centerY - height / 2)
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user