Skip to content

Commit

Permalink
Force redraw to destroy previous tiled image. (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathewjordan authored May 1, 2024
1 parent 9c53003 commit 35a469a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"flexsearch": "^0.7.43",
"hls.js": "^1.5.3",
"node-webvtt": "^1.9.4",
"openseadragon": "^2.4.2",
"openseadragon": "^4.1.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.12",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions src/components/Image/OSD/OSD.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ const OSD: React.FC<OSDProps> = ({
}, [openSeadragon, openSeadragonCallback]);

useEffect(() => {
if (uri !== osdUri) setOsdUri(uri);
}, [osdUri, uri]);
if (openSeadragon && uri !== osdUri) {
openSeadragon.forceRedraw();
setOsdUri(uri);
}
}, [openSeadragon, osdUri, uri]);

useEffect(() => {
if (osdUri && openSeadragon) {
Expand Down

0 comments on commit 35a469a

Please sign in to comment.