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) 428 B
"use strict";var t=require("./calcRotatedObjectPositionAndSize.js");module.exports=function(e){const i=e.map((e=>t(e.rotationAngle,e.x,e.y,e.width,e.height))),h=i[0];let a=h.x,n=h.y,r=a+h.width,o=n+h.height;return i.slice(1).forEach((t=>{a=Math.min(t.x,a),n=Math.min(t.y,n),r=Math.max(t.x+t.width,r),o=Math.max(t.y+t.height,o)})),{startX:a,startY:n,endX:r,endY:o,width:r-a,height:o-n}}; //# sourceMappingURL=getBoundRect.js.map