Skip to content
Snippets Groups Projects
Verified Commit 3cd11bef authored by Loïs Poujade's avatar Loïs Poujade
Browse files

Fix from reviews

Moved and fixed error handling for case where both an image and a video
are present on the same canvas
+ wording
parent 0d64d95b
No related branches found
No related tags found
1 merge request!4Add / edit annotation on video
Pipeline #1252 failed
......@@ -60,10 +60,6 @@ class AnnotationDrawing extends Component {
const osdref = OSDReferences.get(windowId);
const videoref = VideosReferences.get(windowId);
if (osdref && videoref) {
console.error('Unhandled case: both OpenSeadragon (picture viewer) and video player on the same canvas');
}
if (osdref) {
const { viewport } = osdref.current;
const img = osdref.current.world.getItemAt(0);
......@@ -99,7 +95,7 @@ class AnnotationDrawing extends Component {
};
}
throw new Error('Unknown or missing data player, not OpenSeadragon (picture viewer) nor the video player');
throw new Error('Unknown or missing data player, not OpenSeadragon (image viewer) nor the video player');
}
/** Draw SVG on canvas */
......@@ -209,6 +205,9 @@ class AnnotationDrawing extends Component {
if (!osdref && !videoref) {
throw new Error("Unknown or missing data player, didn't found OpenSeadragon (image viewer) nor the video player");
}
if (osdref && videoref) {
throw new Error('Unhandled case: both OpenSeadragon (image viewer) and video player on the same canvas');
}
const container = osdref
? osdref.current.element
: videoref.ref.current.parentElement;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment