rect.js 504 B

123456789101112131415161718
  1. "use strict";
  2. exports.__esModule = true;
  3. exports["default"] = void 0;
  4. var Rect = {
  5. calcRotatedBox: function calcRotatedBox(_ref) {
  6. var width = _ref.width,
  7. height = _ref.height,
  8. rotate = _ref.rotate;
  9. var absRotate = Math.abs(rotate);
  10. return {
  11. width: Math.abs(width * Math.cos(absRotate) + height * Math.sin(absRotate)),
  12. height: Math.abs(height * Math.cos(absRotate) + width * Math.sin(absRotate))
  13. };
  14. }
  15. };
  16. var _default = Rect;
  17. exports["default"] = _default;