@deepnoid/canvas 0.1.8 → 0.1.9

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.
@@ -150,6 +150,15 @@ const XrayViewer = ({ image, hasZoom, coordinates, onImageLoadError, onImageLoad
150
150
  const errorMessage = error instanceof Error ? error.message : 'Image load failed';
151
151
  setImageError(errorMessage);
152
152
  imageRef.current = new Image();
153
+ if (viewer.current) {
154
+ const canvas = viewer.current;
155
+ const ctx = canvas.getContext('2d');
156
+ if (ctx) {
157
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
158
+ }
159
+ }
160
+ setZoom(0);
161
+ setInitZoom(0);
153
162
  onImageLoadError?.(new Error(errorMessage));
154
163
  console.error('Image load failed:', error);
155
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepnoid/canvas",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",