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.cjs
CHANGED
|
@@ -2186,6 +2186,11 @@ function rgba(hex, alpha) {
|
|
|
2186
2186
|
if (Number.isNaN(r) || Number.isNaN(g) || Number.isNaN(b)) return hex;
|
|
2187
2187
|
return `rgba(${r},${g},${b},${alpha})`;
|
|
2188
2188
|
}
|
|
2189
|
+
function dashIntervalsFromStrokeDasharray2(strokeDasharray) {
|
|
2190
|
+
if (!strokeDasharray) return null;
|
|
2191
|
+
const intervals = strokeDasharray.split(/[\s,]+/).map((part) => Number(part)).filter((part) => Number.isFinite(part) && part > 0);
|
|
2192
|
+
return intervals.length > 0 ? intervals : null;
|
|
2193
|
+
}
|
|
2189
2194
|
function localBounds(bounds) {
|
|
2190
2195
|
const b = normalizeRect(bounds);
|
|
2191
2196
|
return { w: Math.max(0, b.width), h: Math.max(0, b.height) };
|
|
@@ -2475,6 +2480,7 @@ function NativeShapeRenderer({ item }) {
|
|
|
2475
2480
|
}
|
|
2476
2481
|
);
|
|
2477
2482
|
}
|
|
2483
|
+
const intervals = dashIntervalsFromStrokeDasharray2(payload.strokeDasharray);
|
|
2478
2484
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2479
2485
|
reactNativeSkia.Path,
|
|
2480
2486
|
{
|
|
@@ -2484,7 +2490,8 @@ function NativeShapeRenderer({ item }) {
|
|
|
2484
2490
|
strokeWidth: payload.strokeWidth,
|
|
2485
2491
|
strokeCap: "round",
|
|
2486
2492
|
strokeJoin: "round",
|
|
2487
|
-
antiAlias: true
|
|
2493
|
+
antiAlias: true,
|
|
2494
|
+
children: intervals ? /* @__PURE__ */ jsxRuntime.jsx(reactNativeSkia.DashPathEffect, { intervals }) : null
|
|
2488
2495
|
}
|
|
2489
2496
|
);
|
|
2490
2497
|
}
|
|
@@ -2658,7 +2665,7 @@ function pointsToSmoothPathD(points) {
|
|
|
2658
2665
|
const d = smoothFreehandPointsToPathD(points);
|
|
2659
2666
|
return d || null;
|
|
2660
2667
|
}
|
|
2661
|
-
function
|
|
2668
|
+
function dashIntervalsFromStrokeDasharray3(strokeDasharray) {
|
|
2662
2669
|
if (!strokeDasharray) return null;
|
|
2663
2670
|
const intervals = strokeDasharray.split(/\s+/).map((part) => Number(part)).filter((part) => Number.isFinite(part) && part > 0);
|
|
2664
2671
|
return intervals.length > 0 ? intervals : null;
|
|
@@ -2948,7 +2955,7 @@ function NativeInteractionOverlay({
|
|
|
2948
2955
|
);
|
|
2949
2956
|
}
|
|
2950
2957
|
if (payload.kind === "strokePath") {
|
|
2951
|
-
const intervals =
|
|
2958
|
+
const intervals = dashIntervalsFromStrokeDasharray3(payload.strokeDasharray);
|
|
2952
2959
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2953
2960
|
reactNativeSkia.Path,
|
|
2954
2961
|
{
|