canvu-react 0.4.38 → 0.4.39
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/native.cjs +10 -3
- package/dist/native.cjs.map +1 -1
- package/dist/native.js +10 -3
- package/dist/native.js.map +1 -1
- package/package.json +1 -1
package/dist/native.js
CHANGED
|
@@ -2180,6 +2180,11 @@ function rgba(hex, alpha) {
|
|
|
2180
2180
|
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) return hex;
|
|
2181
2181
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
2182
2182
|
}
|
|
2183
|
+
function dashIntervalsFromStrokeDasharray2(strokeDasharray) {
|
|
2184
|
+
if (!strokeDasharray) return null;
|
|
2185
|
+
const intervals = strokeDasharray.split(/[\s,]+/).map((part) => Number(part)).filter((part) => Number.isFinite(part) && part > 0);
|
|
2186
|
+
return intervals.length > 0 ? intervals : null;
|
|
2187
|
+
}
|
|
2183
2188
|
function localBounds(bounds) {
|
|
2184
2189
|
const b = normalizeRect(bounds);
|
|
2185
2190
|
return { w: Math.max(0, b.width), h: Math.max(0, b.height) };
|
|
@@ -2469,6 +2474,7 @@ function NativeShapeRenderer({ item }) {
|
|
|
2469
2474
|
}
|
|
2470
2475
|
);
|
|
2471
2476
|
}
|
|
2477
|
+
const intervals = dashIntervalsFromStrokeDasharray2(payload.strokeDasharray);
|
|
2472
2478
|
return /* @__PURE__ */ jsx(
|
|
2473
2479
|
Path,
|
|
2474
2480
|
{
|
|
@@ -2478,7 +2484,8 @@ function NativeShapeRenderer({ item }) {
|
|
|
2478
2484
|
strokeWidth: payload.strokeWidth,
|
|
2479
2485
|
strokeCap: "round",
|
|
2480
2486
|
strokeJoin: "round",
|
|
2481
|
-
antiAlias: true
|
|
2487
|
+
antiAlias: true,
|
|
2488
|
+
children: intervals ? /* @__PURE__ */ jsx(DashPathEffect, { intervals }) : null
|
|
2482
2489
|
}
|
|
2483
2490
|
);
|
|
2484
2491
|
}
|
|
@@ -2652,7 +2659,7 @@ function pointsToSmoothPathD(points) {
|
|
|
2652
2659
|
const d = smoothFreehandPointsToPathD(points);
|
|
2653
2660
|
return d || null;
|
|
2654
2661
|
}
|
|
2655
|
-
function
|
|
2662
|
+
function dashIntervalsFromStrokeDasharray3(strokeDasharray) {
|
|
2656
2663
|
if (!strokeDasharray) return null;
|
|
2657
2664
|
const intervals = strokeDasharray.split(/\s+/).map((part) => Number(part)).filter((part) => Number.isFinite(part) && part > 0);
|
|
2658
2665
|
return intervals.length > 0 ? intervals : null;
|
|
@@ -2942,7 +2949,7 @@ function NativeInteractionOverlay({
|
|
|
2942
2949
|
);
|
|
2943
2950
|
}
|
|
2944
2951
|
if (payload.kind === "strokePath") {
|
|
2945
|
-
const intervals =
|
|
2952
|
+
const intervals = dashIntervalsFromStrokeDasharray3(payload.strokeDasharray);
|
|
2946
2953
|
return /* @__PURE__ */ jsx(
|
|
2947
2954
|
Path,
|
|
2948
2955
|
{
|