rect.js 354 B

12345678910111213141516
  1. var Rect = {
  2. calcRotatedBox(_ref) {
  3. var {
  4. width,
  5. height,
  6. rotate
  7. } = _ref;
  8. var absRotate = Math.abs(rotate);
  9. return {
  10. width: Math.abs(width * Math.cos(absRotate) + height * Math.sin(absRotate)),
  11. height: Math.abs(height * Math.cos(absRotate) + width * Math.sin(absRotate))
  12. };
  13. }
  14. };
  15. export default Rect;