@effing/canvas 0.24.8 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1217,9 +1217,6 @@ function resolveBoxValue(v, referenceWidth) {
1217
1217
  function drawRect(ctx, x, y, width, height, style) {
1218
1218
  const borderRadius = getBorderRadiusFromStyle(style, width, height);
1219
1219
  const hasRoundedCorners = hasRadius(borderRadius);
1220
- if (style.boxShadow) {
1221
- drawBoxShadow(ctx, x, y, width, height, style.boxShadow, borderRadius);
1222
- }
1223
1220
  if (style.backgroundColor) {
1224
1221
  ctx.fillStyle = style.backgroundColor;
1225
1222
  if (hasRoundedCorners) {
@@ -2841,12 +2838,15 @@ async function drawNodeCore(ctx, node, parentX, parentY, offsetX, offsetY, debug
2841
2838
  style.transformOrigin
2842
2839
  );
2843
2840
  }
2841
+ const borderRadius = getBorderRadiusFromStyle(style, width, height);
2842
+ if (style.boxShadow) {
2843
+ drawBoxShadow(ctx, x, y, width, height, style.boxShadow, borderRadius);
2844
+ }
2844
2845
  const isClipped = style.overflow === "hidden" || style.overflowX === "hidden" || style.overflowY === "hidden";
2845
2846
  if (isClipped) {
2846
- const borderRadius = getBorderRadiusFromStyle(style, width, height);
2847
2847
  applyClip(ctx, x, y, width, height, borderRadius);
2848
2848
  }
2849
- if (style.backgroundColor || style.borderTopWidth || style.borderRightWidth || style.borderBottomWidth || style.borderLeftWidth || style.boxShadow) {
2849
+ if (style.backgroundColor || style.borderTopWidth || style.borderRightWidth || style.borderBottomWidth || style.borderLeftWidth) {
2850
2850
  drawRect(ctx, x, y, width, height, style);
2851
2851
  }
2852
2852
  if (style.backgroundImage) {
@@ -2856,7 +2856,6 @@ async function drawNodeCore(ctx, node, parentX, parentY, offsetX, offsetY, debug
2856
2856
  const gradient = createGradientFromCSS(ctx, layer, x, y, width, height);
2857
2857
  if (gradient) {
2858
2858
  ctx.fillStyle = gradient;
2859
- const borderRadius = getBorderRadiusFromStyle(style, width, height);
2860
2859
  if (hasRadius(borderRadius)) {
2861
2860
  ctx.beginPath();
2862
2861
  roundedRect(
@@ -2877,7 +2876,6 @@ async function drawNodeCore(ctx, node, parentX, parentY, offsetX, offsetY, debug
2877
2876
  } else {
2878
2877
  const urlMatch = layer.match(/url\(["']?(.*?)["']?\)/);
2879
2878
  if (urlMatch) {
2880
- const borderRadius = getBorderRadiusFromStyle(style, width, height);
2881
2879
  if (hasRadius(borderRadius)) {
2882
2880
  applyClip(ctx, x, y, width, height, borderRadius);
2883
2881
  }
@@ -2978,7 +2976,6 @@ async function drawNodeCore(ctx, node, parentX, parentY, offsetX, offsetY, debug
2978
2976
  const imgW = width - paddingLeft - paddingRight - borderLeftW - borderRightW;
2979
2977
  const imgH = height - paddingTop - paddingBottom - borderTopW - borderBottomW;
2980
2978
  if (!isClipped) {
2981
- const borderRadius = getBorderRadiusFromStyle(style, width, height);
2982
2979
  if (hasRadius(borderRadius)) {
2983
2980
  applyClip(ctx, imgX, imgY, imgW, imgH, borderRadius);
2984
2981
  }