UNPKG

@googleforcreators/units

Version:

A collection of utility functions as well as a React context provider for dealing with "data" and "editor" pixels in the Web Stories editor.

3 lines (2 loc) 414 B
"use strict";var t=require("./getCorners.js");module.exports=function(i=0,o,e,x,h){if(!i)return{x:o,y:e,width:x,height:h};const{topLeftPoint:n,topRightPoint:r,bottomRightPoint:y,bottomLeftPoint:a}=t(i,o,e,x,h),m=Math.min(n.x,r.x,y.x,a.x),s=Math.min(n.y,r.y,y.y,a.y);return{x:m,y:s,width:Math.max(n.x,r.x,y.x,a.x)-m,height:Math.max(n.y,r.y,y.y,a.y)-s}}; //# sourceMappingURL=calcRotatedObjectPositionAndSize.js.map