frame.image 1.6.7 → 1.6.8

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.
@@ -4,7 +4,7 @@ export declare function Designer(props: {
4
4
  onClose: (rt1: string) => void;
5
5
  nrPoints?: number;
6
6
  trademarkImageUrl?: string;
7
- callBackAfterTransform?: (coordinates: Polygon) => void;
7
+ callbackAfterTransform?: (coordinates: Polygon) => void;
8
8
  callbackAfterScale?: (length: number, height: number) => void;
9
9
  callbackAfterTrademark?: (tradeMark: Point) => void;
10
10
  }): import("react/jsx-runtime").JSX.Element;
package/dist/Designer.js CHANGED
@@ -85,8 +85,8 @@ export function Designer(props) {
85
85
  const onAfterTransform = (coordinates) => {
86
86
  setScalingEnabled(true);
87
87
  sendCommand(ACTION.TRANSFORM);
88
- if (props.callBackAfterTransform) {
89
- props.callBackAfterTransform(coordinates);
88
+ if (props.callbackAfterTransform) {
89
+ props.callbackAfterTransform(coordinates);
90
90
  }
91
91
  };
92
92
  const onReset = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,GAAG,CAAC,OAAO,CAsrBd"}
1
+ {"version":3,"file":"DrawCanvas.d.ts","sourceRoot":"","sources":["../src/DrawCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAqD,MAAM,OAAO,CAAC;AAG/E,OAAO,EACL,SAAS,EACT,WAAW,EACX,UAAU,EACV,aAAa,EACb,KAAK,EACL,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,wBAAgB,UAAU,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,KAAK,CAAC;IACZ,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,eAAe,EAAE,cAAc,CAAC;IAChC,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,GAAG,GAAG,CAAC,OAAO,CA8rBd"}
@@ -98,7 +98,16 @@ export function DrawCanvas(props) {
98
98
  }
99
99
  }
100
100
  if (props.show.catmullRom) {
101
- sortedPoints.drawCatmullRom(context);
101
+ try {
102
+ sortedPoints.drawCatmullRom(context);
103
+ }
104
+ catch (error) {
105
+ console.error('Error drawing Catmull-Rom curve:', error);
106
+ console.error('SortedPoints content:', {
107
+ props: props.coords.coords.Points.map((p) => ({ X: p.X, Y: p.Y })),
108
+ });
109
+ // Handle the error gracefully - continue with other drawing operations
110
+ }
102
111
  }
103
112
  if (props.machine.name === STATUS.FORM_SCALED) {
104
113
  // const trademarkPolygon = props.coords.coords.scale(0.9, 0.9);
@@ -26,5 +26,5 @@ export function ModalDesigner(props) {
26
26
  borderRadius: 2,
27
27
  display: 'flex',
28
28
  flexDirection: 'column',
29
- }, children: _jsx(Designer, { onClose: props.onClose, nrPoints: 128, callBackAfterTransform: logPolygon, callbackAfterScale: logScaling, callbackAfterTrademark: logTrademark }) }) }));
29
+ }, children: _jsx(Designer, { onClose: props.onClose, nrPoints: 128, callbackAfterTransform: logPolygon, callbackAfterScale: logScaling, callbackAfterTrademark: logTrademark }) }) }));
30
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frame.image",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "description": "A React component for drawing a frame on a canvas element.",
5
5
  "license": "MIT",
6
6
  "author": "Christian.Todd@rodenstock.com",