@deepnoid/canvas 0.1.10 → 0.1.11
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,7 @@ 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
|
+
prevImageInfo.current = undefined;
|
|
153
154
|
setZoom(0);
|
|
154
155
|
setInitZoom(0);
|
|
155
156
|
setMoveX(0);
|
|
@@ -162,6 +163,8 @@ const XrayViewer = ({ image, hasZoom, coordinates, onImageLoadError, onImageLoad
|
|
|
162
163
|
const canvas = viewer.current;
|
|
163
164
|
const ctx = canvas.getContext('2d');
|
|
164
165
|
if (ctx) {
|
|
166
|
+
canvas.width = canvas.offsetWidth;
|
|
167
|
+
canvas.height = canvas.offsetHeight;
|
|
165
168
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
166
169
|
}
|
|
167
170
|
}
|