Skip to content
Snippets Groups Projects
Commit b0f95639 authored by Anthony's avatar Anthony
Browse files

App not crashing when opening image viewer

parent d4f56017
No related branches found
No related tags found
1 merge request!10Draft: MigratingAnnotationCreation to MUI5.
......@@ -288,7 +288,7 @@ function AnnotationCreation({
imageEvent,
} = toolState;
const mediaIsVideo = mediaVideo !== 'undefined';
const mediaIsVideo = mediaVideo !== undefined;
if (mediaIsVideo && valueTime) {
valueTime[0] = tstart;
valueTime[1] = tend;
......@@ -302,9 +302,23 @@ function AnnotationCreation({
let overlay = null;
if (videoref) {
overlay = videoref.canvasOverlay;
}
} else {
if (osdref) {
console.debug('osdref', osdref);
overlay = {
canvasHeight: osdref.current.canvas.clientHeight,
canvasWidth: osdref.current.canvas.clientWidth,
containerHeight: osdref.current.canvas.clientHeight,
containerWidth: osdref.current.canvas.clientWidth,
};
} else {
overlay = {
canvasHeight: 500,
canvasWidth: 1000,
containerHeight: 500,
containerWidth: 1000,
};
}
}
/** Change scale from container / canva */
......@@ -430,6 +444,7 @@ function AnnotationCreation({
resetStateAfterSave={resetStateAfterSave}
state={state}
windowId={windowId}
mediaIsVideo={mediaIsVideo}
/>
</StyledForm>
</CompanionWindow>
......
......@@ -23,10 +23,12 @@ function AnnotationFormFooter({
closeFormCompanionWindow,
config,
drawingState,
mediaIsVideo,
receiveAnnotation,
resetStateAfterSave,
state,
windowId,
}) {
/**
* Validate form and save annotation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment