@remotion/rough-notation 4.0.539 → 4.0.541
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/esm/index.mjs +12 -8
- package/dist/render-annotation.d.ts +1 -1
- package/package.json +6 -6
package/dist/esm/index.mjs
CHANGED
|
@@ -94,6 +94,7 @@ var useElementSize = (ref) => {
|
|
|
94
94
|
};
|
|
95
95
|
|
|
96
96
|
// ../paths/dist/esm/index.mjs
|
|
97
|
+
import { NoReactInternals } from "remotion/no-react";
|
|
97
98
|
import {
|
|
98
99
|
interpolate
|
|
99
100
|
} from "remotion/no-react";
|
|
@@ -1336,7 +1337,7 @@ var angleBetween = (v0, v1) => {
|
|
|
1336
1337
|
const p = v0.x * v1.x + v0.y * v1.y;
|
|
1337
1338
|
const n = Math.sqrt((v0.x ** 2 + v0.y ** 2) * (v1.x ** 2 + v1.y ** 2));
|
|
1338
1339
|
const sign = v0.x * v1.y - v0.y * v1.x < 0 ? -1 : 1;
|
|
1339
|
-
const angle = sign * Math.acos(p / n);
|
|
1340
|
+
const angle = sign * Math.acos(Math.max(-1, Math.min(1, p / n)));
|
|
1340
1341
|
return angle;
|
|
1341
1342
|
};
|
|
1342
1343
|
var pointOnEllipticalArc = ({
|
|
@@ -1357,7 +1358,11 @@ var pointOnEllipticalArc = ({
|
|
|
1357
1358
|
return { x: p0.x, y: p0.y, ellipticalArcAngle: 0 };
|
|
1358
1359
|
}
|
|
1359
1360
|
if (rx === 0 || ry === 0) {
|
|
1360
|
-
return {
|
|
1361
|
+
return {
|
|
1362
|
+
x: p0.x + (p1.x - p0.x) * t,
|
|
1363
|
+
y: p0.y + (p1.y - p0.y) * t,
|
|
1364
|
+
ellipticalArcAngle: 0
|
|
1365
|
+
};
|
|
1361
1366
|
}
|
|
1362
1367
|
const dx = (p0.x - p1.x) / 2;
|
|
1363
1368
|
const dy = (p0.y - p1.y) / 2;
|
|
@@ -1514,10 +1519,9 @@ var makeArc = ({
|
|
|
1514
1519
|
const xDist = p2.x - p1.x;
|
|
1515
1520
|
const yDist = p2.y - p1.y;
|
|
1516
1521
|
const dist = Math.sqrt(xDist * xDist + yDist * yDist);
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
}
|
|
1520
|
-
return { x: xDist / dist, y: yDist / dist };
|
|
1522
|
+
const forward = fractionLength < length - point_dist ? 1 : -1;
|
|
1523
|
+
const sign = NoReactInternals.ENABLE_V5_BREAKING_CHANGES ? forward : -forward;
|
|
1524
|
+
return { x: sign * xDist / dist, y: sign * yDist / dist };
|
|
1521
1525
|
},
|
|
1522
1526
|
getTotalLength: () => {
|
|
1523
1527
|
return length;
|
|
@@ -1801,7 +1805,7 @@ var constructFromInstructions = (instructions) => {
|
|
|
1801
1805
|
functions.push(linearCurve);
|
|
1802
1806
|
totalLength += linearCurve.getTotalLength();
|
|
1803
1807
|
}
|
|
1804
|
-
prev_point = [2 * cur[0] - prev_point[0], 2 * cur[1] - prev_point[1]];
|
|
1808
|
+
prev_point = prevWasQ ? [2 * cur[0] - prev_point[0], 2 * cur[1] - prev_point[1]] : [cur[0], cur[1]];
|
|
1805
1809
|
cur = [instruction.x, instruction.y];
|
|
1806
1810
|
}
|
|
1807
1811
|
if (instruction.type === "t") {
|
|
@@ -1828,7 +1832,7 @@ var constructFromInstructions = (instructions) => {
|
|
|
1828
1832
|
totalLength += linearCurve.getTotalLength();
|
|
1829
1833
|
functions.push(linearCurve);
|
|
1830
1834
|
}
|
|
1831
|
-
prev_point = [2 * cur[0] - prev_point[0], 2 * cur[1] - prev_point[1]];
|
|
1835
|
+
prev_point = prevWasQ ? [2 * cur[0] - prev_point[0], 2 * cur[1] - prev_point[1]] : [cur[0], cur[1]];
|
|
1832
1836
|
cur = [instruction.dx + cur[0], instruction.dy + cur[1]];
|
|
1833
1837
|
}
|
|
1834
1838
|
if (instruction.type === "A") {
|
|
@@ -19,4 +19,4 @@ export declare const renderAnnotation: ({ rect, config, seed, progress, options,
|
|
|
19
19
|
readonly seed: number;
|
|
20
20
|
readonly progress: number;
|
|
21
21
|
readonly options: RoughAnnotationOptions;
|
|
22
|
-
}) => import("react
|
|
22
|
+
}) => import("react").JSX.Element[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/rough-notation",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.541",
|
|
4
4
|
"description": "Rough annotation primitives for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"url": "https://github.com/remotion-dev/remotion/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@remotion/paths": "4.0.
|
|
30
|
-
"remotion": "4.0.
|
|
29
|
+
"@remotion/paths": "4.0.541",
|
|
30
|
+
"remotion": "4.0.541",
|
|
31
31
|
"roughjs": "4.6.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"./package.json": "./package.json"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"react": "19.
|
|
47
|
-
"react-dom": "19.
|
|
48
|
-
"@remotion/eslint-config-internal": "4.0.
|
|
46
|
+
"react": "19.3.1",
|
|
47
|
+
"react-dom": "19.3.1",
|
|
48
|
+
"@remotion/eslint-config-internal": "4.0.541",
|
|
49
49
|
"eslint": "9.19.0",
|
|
50
50
|
"typescript": "7.1.0-beta"
|
|
51
51
|
},
|