@deepnoid/canvas 0.1.9 → 0.1.10
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,14 @@ 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
|
+
setZoom(0);
|
|
154
|
+
setInitZoom(0);
|
|
155
|
+
setMoveX(0);
|
|
156
|
+
setMoveY(0);
|
|
157
|
+
setDx(0);
|
|
158
|
+
setDy(0);
|
|
159
|
+
setDw(0);
|
|
160
|
+
setDh(0);
|
|
153
161
|
if (viewer.current) {
|
|
154
162
|
const canvas = viewer.current;
|
|
155
163
|
const ctx = canvas.getContext('2d');
|
|
@@ -157,8 +165,7 @@ const XrayViewer = ({ image, hasZoom, coordinates, onImageLoadError, onImageLoad
|
|
|
157
165
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
158
166
|
}
|
|
159
167
|
}
|
|
160
|
-
|
|
161
|
-
setInitZoom(0);
|
|
168
|
+
setImageOnloadCount((prev) => prev + 1);
|
|
162
169
|
onImageLoadError?.(new Error(errorMessage));
|
|
163
170
|
console.error('Image load failed:', error);
|
|
164
171
|
}
|