UNPKG

@tomiaa/live2d

Version:
2 lines (1 loc) 522 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../constants.js");class n{static calculateWidth(t,r){let e=window.innerWidth*i.CONTAINER_WIDTH_RATIO;return e>t&&(e=t),e<r&&(e=r),e}static calculateHeight(t,r,e=[10,9]){const u=(r==null?void 0:r.aspectRatio)||e;return t/u[0]*u[1]}static calculateModelScale(t,r,e,u){return t>r?e/t:u/r}static getCustomScale(t){return typeof t=="number"?{x:t,y:t}:{x:(t==null?void 0:t.x)||1,y:(t==null?void 0:t.y)||1}}}exports.ResizeHelper=n;