fixClipWithShadow.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. "use strict";
  2. exports.__esModule = true;
  3. var env_1 = require("../../core/env");
  4. var shadowTemp = [
  5. ['shadowBlur', 0],
  6. ['shadowColor', '#000'],
  7. ['shadowOffsetX', 0],
  8. ['shadowOffsetY', 0]
  9. ];
  10. function default_1(orignalBrush) {
  11. return (env_1["default"].browser.ie && env_1["default"].browser.version >= 11)
  12. ? function (ctx, prevEl) {
  13. var clipPaths = this.__clipPaths;
  14. var style = this.style;
  15. var modified;
  16. if (clipPaths) {
  17. for (var i = 0; i < clipPaths.length; i++) {
  18. var clipPath = clipPaths[i];
  19. var shape = clipPath && clipPath.shape;
  20. var type = clipPath && clipPath.type;
  21. if (shape && ((type === 'sector' && shape.startAngle === shape.endAngle)
  22. || (type === 'rect' && (!shape.width || !shape.height)))) {
  23. for (var j = 0; j < shadowTemp.length; j++) {
  24. shadowTemp[j][2] = style[shadowTemp[j][0]];
  25. style[shadowTemp[j][0]] = shadowTemp[j][1];
  26. }
  27. modified = true;
  28. break;
  29. }
  30. }
  31. }
  32. orignalBrush.call(this, ctx, prevEl);
  33. if (modified) {
  34. for (var j = 0; j < shadowTemp.length; j++) {
  35. style[shadowTemp[j][0]] = shadowTemp[j][2];
  36. }
  37. }
  38. }
  39. : orignalBrush;
  40. }
  41. exports["default"] = default_1;
  42. //# sourceMappingURL=fixClipWithShadow.js.map