emf-converter 4.8.12 → 4.8.14

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/browser.js CHANGED
@@ -11732,10 +11732,10 @@ function roundRectCorners(l, t, r, b, cw, ch, compatible = false, clockwise = fa
11732
11732
  ew = 0;
11733
11733
  eh = 0;
11734
11734
  }
11735
- const hy = compatible ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11735
+ const hy = compatible || clockwise ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11736
11736
  const topX = compatible ? Math.round(r - ew / 2) : Math.floor(r - ew / 2);
11737
11737
  const hx = r - topX;
11738
- const verticalControl = compatible && clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11738
+ const verticalControl = clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11739
11739
  const horizontalControl = Math.ceil(KAPPA * hx);
11740
11740
  const q = [r, t + hy, r, t + hy - verticalControl, r - hx + horizontalControl, t, topX, t];
11741
11741
  const mx = (x) => l + r - x;
@@ -15906,7 +15906,7 @@ function stopColorAt(stops, t) {
15906
15906
  }
15907
15907
  return stops[stops.length - 1].argb;
15908
15908
  }
15909
- function pathGradientColorAt(shape, x, y) {
15909
+ function pathGradientColorAt(shape, x, y, focusPoint) {
15910
15910
  const { center, boundary, boundaryArgb } = shape;
15911
15911
  const n = boundary.length;
15912
15912
  const px = x - center.x;
@@ -15955,6 +15955,10 @@ function pathGradientColorAt(shape, x, y) {
15955
15955
  const ey = b.y - a.y;
15956
15956
  const cross = ax * ey - ay * ex;
15957
15957
  if (Math.abs(cross) < 1e-12) continue;
15958
+ if (fx === 0 && fy > 0 && Math.abs((focusPoint?.x ?? x) - center.x) < eps && ex > 0 && Math.max(ax, ax + ex) > 0 && Math.abs(ey) > eps) {
15959
+ const u = (((focusPoint?.y ?? y) - center.y) / fy - ay) / ey;
15960
+ if (u >= -eps && u <= 1 + eps) inFocus = true;
15961
+ }
15958
15962
  if ((fx > 0 || Math.abs(px) < eps) && (fy > 0 || Math.abs(py) < eps)) {
15959
15963
  const x2 = fx > 0 ? px / fx : 0;
15960
15964
  const y2 = fy > 0 ? py / fy : 0;
@@ -16703,7 +16707,8 @@ function correctRedEyeArea(out, stride, x0, y0, x1, y1, carry) {
16703
16707
  const meanDark = sectorDark[s] / sectorCount[s];
16704
16708
  const ratio = meanDark > 0 ? dark[k] / meanDark : 1;
16705
16709
  const u = distance[k] / radius;
16706
- const falloff = Math.max(strength * (1 - u) * (1 - u), 0.5 * Math.max(0, 1 - ratio) ** 2);
16710
+ const darknessFalloff = ratio < 2 ? 0.5 * (1 - ratio) ** 2 : 0;
16711
+ const falloff = Math.max(strength * (1 - u) * (1 - u), darknessFalloff);
16707
16712
  const rest = (1 - falloff) * mean;
16708
16713
  if (rest >= v) {
16709
16714
  continue;
@@ -29785,7 +29790,7 @@ function roundRectDeviceBeziers(box, cw, ch, clockwise = false, compatible = fal
29785
29790
  for (let i = 0; i < q.length; i += 2) {
29786
29791
  pts.push(...map(q[i], clockwise ? f.t + f.b - q[i + 1] : q[i + 1]));
29787
29792
  }
29788
- if (box.halfX && !clockwise) {
29793
+ if (box.halfX) {
29789
29794
  for (const k of [1, 2, 3, 4, 5, 6, 8, 15]) {
29790
29795
  pts[2 * k]++;
29791
29796
  }
@@ -30409,7 +30414,8 @@ function pathGradientSampler(shape, wrap, device) {
30409
30414
  by = foldIntoTile(by, box.y, box.h, mirrorY, lagY);
30410
30415
  }
30411
30416
  if (wrap === "clamp" && by >= box.y + box.h) continue;
30412
- const c = pathGradientColorAt(shape, bx, by);
30417
+ const focusPoint = bias && shape.focus?.x === 0 ? { x: bx - inv2[0] * bias, y: by - inv2[1] * bias } : void 0;
30418
+ const c = pathGradientColorAt(shape, bx, by, focusPoint);
30413
30419
  if (c === null) {
30414
30420
  continue;
30415
30421
  }
@@ -30875,7 +30881,7 @@ function fixExtent(rCtx, v, axis) {
30875
30881
  return Math.round(Math.abs(v) * k * 16);
30876
30882
  }
30877
30883
  var PS_INSIDEFRAME = 6;
30878
- function insideFrameInset(rCtx, box, rectangle = false) {
30884
+ function insideFrameInset(rCtx, box, rectangle = false, clockwiseRoundRect = false) {
30879
30885
  if ((rCtx.state.penStyle & 15) !== PS_INSIDEFRAME || !isAxisBox(box) || hasWorldRotation(rCtx)) {
30880
30886
  return null;
30881
30887
  }
@@ -30894,7 +30900,7 @@ function insideFrameInset(rCtx, box, rectangle = false) {
30894
30900
  }
30895
30901
  const lo = Math.floor(wx / 2);
30896
30902
  const hi = Math.ceil(wx / 2);
30897
- const y = Math.round(Math.ceil(wy / 2) * py);
30903
+ const y = Math.round((clockwiseRoundRect ? Math.floor(wy / 2) : Math.ceil(wy / 2)) * py);
30898
30904
  return {
30899
30905
  left: Math.round((rectangle ? hi : lo) * px),
30900
30906
  right: Math.round((rectangle ? lo : hi) * px),
@@ -31158,7 +31164,7 @@ function handleRoundRect(rCtx, dataOff, recSize) {
31158
31164
  const cornerH = view.getInt32(dataOff + 20, true);
31159
31165
  const clockwise = rCtx.state.arcDirection === 2;
31160
31166
  const unframed = uprightFixBox(rCtx, l, t, r, b);
31161
- const inset = insideFrameInset(rCtx, unframed);
31167
+ const inset = insideFrameInset(rCtx, unframed, false, clockwise);
31162
31168
  const framed = inset ? insetFixBox(unframed, inset) : unframed;
31163
31169
  const devM = gdiDeviceMatrix(rCtx);
31164
31170
  const cornerFixW = inset ? Math.abs(cornerW * devM[0]) * 16 : fixExtent(rCtx, cornerW, 0);
package/dist/browser.mjs CHANGED
@@ -11730,10 +11730,10 @@ function roundRectCorners(l, t, r, b, cw, ch, compatible = false, clockwise = fa
11730
11730
  ew = 0;
11731
11731
  eh = 0;
11732
11732
  }
11733
- const hy = compatible ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11733
+ const hy = compatible || clockwise ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11734
11734
  const topX = compatible ? Math.round(r - ew / 2) : Math.floor(r - ew / 2);
11735
11735
  const hx = r - topX;
11736
- const verticalControl = compatible && clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11736
+ const verticalControl = clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11737
11737
  const horizontalControl = Math.ceil(KAPPA * hx);
11738
11738
  const q = [r, t + hy, r, t + hy - verticalControl, r - hx + horizontalControl, t, topX, t];
11739
11739
  const mx = (x) => l + r - x;
@@ -15904,7 +15904,7 @@ function stopColorAt(stops, t) {
15904
15904
  }
15905
15905
  return stops[stops.length - 1].argb;
15906
15906
  }
15907
- function pathGradientColorAt(shape, x, y) {
15907
+ function pathGradientColorAt(shape, x, y, focusPoint) {
15908
15908
  const { center, boundary, boundaryArgb } = shape;
15909
15909
  const n = boundary.length;
15910
15910
  const px = x - center.x;
@@ -15953,6 +15953,10 @@ function pathGradientColorAt(shape, x, y) {
15953
15953
  const ey = b.y - a.y;
15954
15954
  const cross = ax * ey - ay * ex;
15955
15955
  if (Math.abs(cross) < 1e-12) continue;
15956
+ if (fx === 0 && fy > 0 && Math.abs((focusPoint?.x ?? x) - center.x) < eps && ex > 0 && Math.max(ax, ax + ex) > 0 && Math.abs(ey) > eps) {
15957
+ const u = (((focusPoint?.y ?? y) - center.y) / fy - ay) / ey;
15958
+ if (u >= -eps && u <= 1 + eps) inFocus = true;
15959
+ }
15956
15960
  if ((fx > 0 || Math.abs(px) < eps) && (fy > 0 || Math.abs(py) < eps)) {
15957
15961
  const x2 = fx > 0 ? px / fx : 0;
15958
15962
  const y2 = fy > 0 ? py / fy : 0;
@@ -16701,7 +16705,8 @@ function correctRedEyeArea(out, stride, x0, y0, x1, y1, carry) {
16701
16705
  const meanDark = sectorDark[s] / sectorCount[s];
16702
16706
  const ratio = meanDark > 0 ? dark[k] / meanDark : 1;
16703
16707
  const u = distance[k] / radius;
16704
- const falloff = Math.max(strength * (1 - u) * (1 - u), 0.5 * Math.max(0, 1 - ratio) ** 2);
16708
+ const darknessFalloff = ratio < 2 ? 0.5 * (1 - ratio) ** 2 : 0;
16709
+ const falloff = Math.max(strength * (1 - u) * (1 - u), darknessFalloff);
16705
16710
  const rest = (1 - falloff) * mean;
16706
16711
  if (rest >= v) {
16707
16712
  continue;
@@ -29783,7 +29788,7 @@ function roundRectDeviceBeziers(box, cw, ch, clockwise = false, compatible = fal
29783
29788
  for (let i = 0; i < q.length; i += 2) {
29784
29789
  pts.push(...map(q[i], clockwise ? f.t + f.b - q[i + 1] : q[i + 1]));
29785
29790
  }
29786
- if (box.halfX && !clockwise) {
29791
+ if (box.halfX) {
29787
29792
  for (const k of [1, 2, 3, 4, 5, 6, 8, 15]) {
29788
29793
  pts[2 * k]++;
29789
29794
  }
@@ -30407,7 +30412,8 @@ function pathGradientSampler(shape, wrap, device) {
30407
30412
  by = foldIntoTile(by, box.y, box.h, mirrorY, lagY);
30408
30413
  }
30409
30414
  if (wrap === "clamp" && by >= box.y + box.h) continue;
30410
- const c = pathGradientColorAt(shape, bx, by);
30415
+ const focusPoint = bias && shape.focus?.x === 0 ? { x: bx - inv2[0] * bias, y: by - inv2[1] * bias } : void 0;
30416
+ const c = pathGradientColorAt(shape, bx, by, focusPoint);
30411
30417
  if (c === null) {
30412
30418
  continue;
30413
30419
  }
@@ -30873,7 +30879,7 @@ function fixExtent(rCtx, v, axis) {
30873
30879
  return Math.round(Math.abs(v) * k * 16);
30874
30880
  }
30875
30881
  var PS_INSIDEFRAME = 6;
30876
- function insideFrameInset(rCtx, box, rectangle = false) {
30882
+ function insideFrameInset(rCtx, box, rectangle = false, clockwiseRoundRect = false) {
30877
30883
  if ((rCtx.state.penStyle & 15) !== PS_INSIDEFRAME || !isAxisBox(box) || hasWorldRotation(rCtx)) {
30878
30884
  return null;
30879
30885
  }
@@ -30892,7 +30898,7 @@ function insideFrameInset(rCtx, box, rectangle = false) {
30892
30898
  }
30893
30899
  const lo = Math.floor(wx / 2);
30894
30900
  const hi = Math.ceil(wx / 2);
30895
- const y = Math.round(Math.ceil(wy / 2) * py);
30901
+ const y = Math.round((clockwiseRoundRect ? Math.floor(wy / 2) : Math.ceil(wy / 2)) * py);
30896
30902
  return {
30897
30903
  left: Math.round((rectangle ? hi : lo) * px),
30898
30904
  right: Math.round((rectangle ? lo : hi) * px),
@@ -31156,7 +31162,7 @@ function handleRoundRect(rCtx, dataOff, recSize) {
31156
31162
  const cornerH = view.getInt32(dataOff + 20, true);
31157
31163
  const clockwise = rCtx.state.arcDirection === 2;
31158
31164
  const unframed = uprightFixBox(rCtx, l, t, r, b);
31159
- const inset = insideFrameInset(rCtx, unframed);
31165
+ const inset = insideFrameInset(rCtx, unframed, false, clockwise);
31160
31166
  const framed = inset ? insetFixBox(unframed, inset) : unframed;
31161
31167
  const devM = gdiDeviceMatrix(rCtx);
31162
31168
  const cornerFixW = inset ? Math.abs(cornerW * devM[0]) * 16 : fixExtent(rCtx, cornerW, 0);
package/dist/index.js CHANGED
@@ -11733,10 +11733,10 @@ function roundRectCorners(l, t, r, b, cw, ch, compatible = false, clockwise = fa
11733
11733
  ew = 0;
11734
11734
  eh = 0;
11735
11735
  }
11736
- const hy = compatible ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11736
+ const hy = compatible || clockwise ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11737
11737
  const topX = compatible ? Math.round(r - ew / 2) : Math.floor(r - ew / 2);
11738
11738
  const hx = r - topX;
11739
- const verticalControl = compatible && clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11739
+ const verticalControl = clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11740
11740
  const horizontalControl = Math.ceil(KAPPA * hx);
11741
11741
  const q = [r, t + hy, r, t + hy - verticalControl, r - hx + horizontalControl, t, topX, t];
11742
11742
  const mx = (x) => l + r - x;
@@ -15907,7 +15907,7 @@ function stopColorAt(stops, t) {
15907
15907
  }
15908
15908
  return stops[stops.length - 1].argb;
15909
15909
  }
15910
- function pathGradientColorAt(shape, x, y) {
15910
+ function pathGradientColorAt(shape, x, y, focusPoint) {
15911
15911
  const { center, boundary, boundaryArgb } = shape;
15912
15912
  const n = boundary.length;
15913
15913
  const px = x - center.x;
@@ -15956,6 +15956,10 @@ function pathGradientColorAt(shape, x, y) {
15956
15956
  const ey = b.y - a.y;
15957
15957
  const cross = ax * ey - ay * ex;
15958
15958
  if (Math.abs(cross) < 1e-12) continue;
15959
+ if (fx === 0 && fy > 0 && Math.abs((focusPoint?.x ?? x) - center.x) < eps && ex > 0 && Math.max(ax, ax + ex) > 0 && Math.abs(ey) > eps) {
15960
+ const u = (((focusPoint?.y ?? y) - center.y) / fy - ay) / ey;
15961
+ if (u >= -eps && u <= 1 + eps) inFocus = true;
15962
+ }
15959
15963
  if ((fx > 0 || Math.abs(px) < eps) && (fy > 0 || Math.abs(py) < eps)) {
15960
15964
  const x2 = fx > 0 ? px / fx : 0;
15961
15965
  const y2 = fy > 0 ? py / fy : 0;
@@ -16704,7 +16708,8 @@ function correctRedEyeArea(out, stride, x0, y0, x1, y1, carry) {
16704
16708
  const meanDark = sectorDark[s] / sectorCount[s];
16705
16709
  const ratio = meanDark > 0 ? dark[k] / meanDark : 1;
16706
16710
  const u = distance[k] / radius;
16707
- const falloff = Math.max(strength * (1 - u) * (1 - u), 0.5 * Math.max(0, 1 - ratio) ** 2);
16711
+ const darknessFalloff = ratio < 2 ? 0.5 * (1 - ratio) ** 2 : 0;
16712
+ const falloff = Math.max(strength * (1 - u) * (1 - u), darknessFalloff);
16708
16713
  const rest = (1 - falloff) * mean;
16709
16714
  if (rest >= v) {
16710
16715
  continue;
@@ -29786,7 +29791,7 @@ function roundRectDeviceBeziers(box, cw, ch, clockwise = false, compatible = fal
29786
29791
  for (let i = 0; i < q.length; i += 2) {
29787
29792
  pts.push(...map(q[i], clockwise ? f.t + f.b - q[i + 1] : q[i + 1]));
29788
29793
  }
29789
- if (box.halfX && !clockwise) {
29794
+ if (box.halfX) {
29790
29795
  for (const k of [1, 2, 3, 4, 5, 6, 8, 15]) {
29791
29796
  pts[2 * k]++;
29792
29797
  }
@@ -30410,7 +30415,8 @@ function pathGradientSampler(shape, wrap, device) {
30410
30415
  by = foldIntoTile(by, box.y, box.h, mirrorY, lagY);
30411
30416
  }
30412
30417
  if (wrap === "clamp" && by >= box.y + box.h) continue;
30413
- const c = pathGradientColorAt(shape, bx, by);
30418
+ const focusPoint = bias && shape.focus?.x === 0 ? { x: bx - inv2[0] * bias, y: by - inv2[1] * bias } : void 0;
30419
+ const c = pathGradientColorAt(shape, bx, by, focusPoint);
30414
30420
  if (c === null) {
30415
30421
  continue;
30416
30422
  }
@@ -30876,7 +30882,7 @@ function fixExtent(rCtx, v, axis) {
30876
30882
  return Math.round(Math.abs(v) * k * 16);
30877
30883
  }
30878
30884
  var PS_INSIDEFRAME = 6;
30879
- function insideFrameInset(rCtx, box, rectangle = false) {
30885
+ function insideFrameInset(rCtx, box, rectangle = false, clockwiseRoundRect = false) {
30880
30886
  if ((rCtx.state.penStyle & 15) !== PS_INSIDEFRAME || !isAxisBox(box) || hasWorldRotation(rCtx)) {
30881
30887
  return null;
30882
30888
  }
@@ -30895,7 +30901,7 @@ function insideFrameInset(rCtx, box, rectangle = false) {
30895
30901
  }
30896
30902
  const lo = Math.floor(wx / 2);
30897
30903
  const hi = Math.ceil(wx / 2);
30898
- const y = Math.round(Math.ceil(wy / 2) * py);
30904
+ const y = Math.round((clockwiseRoundRect ? Math.floor(wy / 2) : Math.ceil(wy / 2)) * py);
30899
30905
  return {
30900
30906
  left: Math.round((rectangle ? hi : lo) * px),
30901
30907
  right: Math.round((rectangle ? lo : hi) * px),
@@ -31159,7 +31165,7 @@ function handleRoundRect(rCtx, dataOff, recSize) {
31159
31165
  const cornerH = view.getInt32(dataOff + 20, true);
31160
31166
  const clockwise = rCtx.state.arcDirection === 2;
31161
31167
  const unframed = uprightFixBox(rCtx, l, t, r, b);
31162
- const inset = insideFrameInset(rCtx, unframed);
31168
+ const inset = insideFrameInset(rCtx, unframed, false, clockwise);
31163
31169
  const framed = inset ? insetFixBox(unframed, inset) : unframed;
31164
31170
  const devM = gdiDeviceMatrix(rCtx);
31165
31171
  const cornerFixW = inset ? Math.abs(cornerW * devM[0]) * 16 : fixExtent(rCtx, cornerW, 0);
package/dist/index.mjs CHANGED
@@ -11731,10 +11731,10 @@ function roundRectCorners(l, t, r, b, cw, ch, compatible = false, clockwise = fa
11731
11731
  ew = 0;
11732
11732
  eh = 0;
11733
11733
  }
11734
- const hy = compatible ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11734
+ const hy = compatible || clockwise ? Math.round(eh / 2) : Math.floor(h / 2) - Math.floor((h - eh) / 2);
11735
11735
  const topX = compatible ? Math.round(r - ew / 2) : Math.floor(r - ew / 2);
11736
11736
  const hx = r - topX;
11737
- const verticalControl = compatible && clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11737
+ const verticalControl = clockwise ? Math.ceil(KAPPA * hy) : Math.floor(KAPPA * hy);
11738
11738
  const horizontalControl = Math.ceil(KAPPA * hx);
11739
11739
  const q = [r, t + hy, r, t + hy - verticalControl, r - hx + horizontalControl, t, topX, t];
11740
11740
  const mx = (x) => l + r - x;
@@ -15905,7 +15905,7 @@ function stopColorAt(stops, t) {
15905
15905
  }
15906
15906
  return stops[stops.length - 1].argb;
15907
15907
  }
15908
- function pathGradientColorAt(shape, x, y) {
15908
+ function pathGradientColorAt(shape, x, y, focusPoint) {
15909
15909
  const { center, boundary, boundaryArgb } = shape;
15910
15910
  const n = boundary.length;
15911
15911
  const px = x - center.x;
@@ -15954,6 +15954,10 @@ function pathGradientColorAt(shape, x, y) {
15954
15954
  const ey = b.y - a.y;
15955
15955
  const cross = ax * ey - ay * ex;
15956
15956
  if (Math.abs(cross) < 1e-12) continue;
15957
+ if (fx === 0 && fy > 0 && Math.abs((focusPoint?.x ?? x) - center.x) < eps && ex > 0 && Math.max(ax, ax + ex) > 0 && Math.abs(ey) > eps) {
15958
+ const u = (((focusPoint?.y ?? y) - center.y) / fy - ay) / ey;
15959
+ if (u >= -eps && u <= 1 + eps) inFocus = true;
15960
+ }
15957
15961
  if ((fx > 0 || Math.abs(px) < eps) && (fy > 0 || Math.abs(py) < eps)) {
15958
15962
  const x2 = fx > 0 ? px / fx : 0;
15959
15963
  const y2 = fy > 0 ? py / fy : 0;
@@ -16702,7 +16706,8 @@ function correctRedEyeArea(out, stride, x0, y0, x1, y1, carry) {
16702
16706
  const meanDark = sectorDark[s] / sectorCount[s];
16703
16707
  const ratio = meanDark > 0 ? dark[k] / meanDark : 1;
16704
16708
  const u = distance[k] / radius;
16705
- const falloff = Math.max(strength * (1 - u) * (1 - u), 0.5 * Math.max(0, 1 - ratio) ** 2);
16709
+ const darknessFalloff = ratio < 2 ? 0.5 * (1 - ratio) ** 2 : 0;
16710
+ const falloff = Math.max(strength * (1 - u) * (1 - u), darknessFalloff);
16706
16711
  const rest = (1 - falloff) * mean;
16707
16712
  if (rest >= v) {
16708
16713
  continue;
@@ -29784,7 +29789,7 @@ function roundRectDeviceBeziers(box, cw, ch, clockwise = false, compatible = fal
29784
29789
  for (let i = 0; i < q.length; i += 2) {
29785
29790
  pts.push(...map(q[i], clockwise ? f.t + f.b - q[i + 1] : q[i + 1]));
29786
29791
  }
29787
- if (box.halfX && !clockwise) {
29792
+ if (box.halfX) {
29788
29793
  for (const k of [1, 2, 3, 4, 5, 6, 8, 15]) {
29789
29794
  pts[2 * k]++;
29790
29795
  }
@@ -30408,7 +30413,8 @@ function pathGradientSampler(shape, wrap, device) {
30408
30413
  by = foldIntoTile(by, box.y, box.h, mirrorY, lagY);
30409
30414
  }
30410
30415
  if (wrap === "clamp" && by >= box.y + box.h) continue;
30411
- const c = pathGradientColorAt(shape, bx, by);
30416
+ const focusPoint = bias && shape.focus?.x === 0 ? { x: bx - inv2[0] * bias, y: by - inv2[1] * bias } : void 0;
30417
+ const c = pathGradientColorAt(shape, bx, by, focusPoint);
30412
30418
  if (c === null) {
30413
30419
  continue;
30414
30420
  }
@@ -30874,7 +30880,7 @@ function fixExtent(rCtx, v, axis) {
30874
30880
  return Math.round(Math.abs(v) * k * 16);
30875
30881
  }
30876
30882
  var PS_INSIDEFRAME = 6;
30877
- function insideFrameInset(rCtx, box, rectangle = false) {
30883
+ function insideFrameInset(rCtx, box, rectangle = false, clockwiseRoundRect = false) {
30878
30884
  if ((rCtx.state.penStyle & 15) !== PS_INSIDEFRAME || !isAxisBox(box) || hasWorldRotation(rCtx)) {
30879
30885
  return null;
30880
30886
  }
@@ -30893,7 +30899,7 @@ function insideFrameInset(rCtx, box, rectangle = false) {
30893
30899
  }
30894
30900
  const lo = Math.floor(wx / 2);
30895
30901
  const hi = Math.ceil(wx / 2);
30896
- const y = Math.round(Math.ceil(wy / 2) * py);
30902
+ const y = Math.round((clockwiseRoundRect ? Math.floor(wy / 2) : Math.ceil(wy / 2)) * py);
30897
30903
  return {
30898
30904
  left: Math.round((rectangle ? hi : lo) * px),
30899
30905
  right: Math.round((rectangle ? lo : hi) * px),
@@ -31157,7 +31163,7 @@ function handleRoundRect(rCtx, dataOff, recSize) {
31157
31163
  const cornerH = view.getInt32(dataOff + 20, true);
31158
31164
  const clockwise = rCtx.state.arcDirection === 2;
31159
31165
  const unframed = uprightFixBox(rCtx, l, t, r, b);
31160
- const inset = insideFrameInset(rCtx, unframed);
31166
+ const inset = insideFrameInset(rCtx, unframed, false, clockwise);
31161
31167
  const framed = inset ? insetFixBox(unframed, inset) : unframed;
31162
31168
  const devM = gdiDeviceMatrix(rCtx);
31163
31169
  const cornerFixW = inset ? Math.abs(cornerW * devM[0]) * 16 : fixExtent(rCtx, cornerW, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emf-converter",
3
- "version": "4.8.12",
3
+ "version": "4.8.14",
4
4
  "description": "Convert EMF/WMF metafile binaries to PNG data URLs or SVG (markup, data URL, React/JSX)",
5
5
  "keywords": [
6
6
  "canvas",